Educational Codeforces Round 17

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
762 Educational Codeforces Round 17 FINISHED False 7200 291050723 Jan. 25, 2017, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 478 ) F Tree nesting PROGRAMMING combinatorics graphs trees 2900

You are given two trees (connected undirected acyclic graphs) S and T. Count the number of subtrees (connected subgraphs) of S that are isomorphic to tree T. Since this number can get quite large, output it modulo 109 + 7. Two subtrees of tree S are considered different, if there exists a vertex in S that belongs to exactly one of them. Tree G is called isomorphic to tree H if there exists a bijection f from the set of vertices of G to the set of vertices of H that has the following property: if there is an edge between vertices A and B in tree G, then there must be an edge between vertices f(A) and f(B) in tree H. And vice versa -- if there is an edge between vertices A and B in tree H, there must be an edge between f - 1(A) and f - 1(B) in tree G. The first line contains a single integer |S| (1 ≤ |S| ≤ 1000) -- the number of vertices of tree S. Next |S| - 1 lines contain two integers ui and vi (1 ≤ ui, vi ≤ |S|) and describe edges of tree S. The next line contains a single integer |T| (1 ≤ |T| ≤ 12) -- the number of vertices of tree T. Next |T| - 1 lines contain two integers xi and yi (1 ≤ xi, yi ≤ |T|) and describe edges of tree T. On the first line output a single integer -- the answer to the given task modulo 109 + 7.

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50636605 kczno1 F March 1, 2019, 12:05 p.m. OK Clang++17 Diagnostics TESTS 79 421 137932800 2900
50636512 kczno1 F March 1, 2019, 12:02 p.m. OK Clang++17 Diagnostics TESTS 79 592 138035200 2900
24488366 zhshr F Feb. 7, 2017, 1:06 p.m. OK GNU C++ TESTS 79 30 35840000 2900
40982591 ReaLNero1 F July 30, 2018, 6:29 p.m. OK GNU C++ TESTS 79 31 33792000 2900
27947202 zhan8855 F June 21, 2017, 1:47 p.m. OK GNU C++ TESTS 79 109 2457600 2900
24259463 immortalCO F Jan. 30, 2017, 4:09 a.m. OK GNU C++ TESTS 79 109 19046400 2900
27947169 zhan8855 F June 21, 2017, 1:46 p.m. OK GNU C++ TESTS 79 140 137728000 2900
27661387 XuYipei F June 8, 2017, 2:05 a.m. OK GNU C++ TESTS 79 264 101273600 2900
24189589 guille F Jan. 27, 2017, 2:46 p.m. OK GNU C++ TESTS 79 265 28672000 2900
24188717 baxbaxa F Jan. 27, 2017, 2:07 p.m. OK GNU C++ TESTS 79 483 19763200 2900
24739149 MemS F Feb. 17, 2017, 1:06 p.m. OK GNU C++ TESTS 79 624 2150400 2900
30536592 wzj152501 F Sept. 20, 2017, 6:45 a.m. OK GNU C++ TESTS 79 1045 614400 2900
51004070 Hzyuer F March 8, 2019, 8:28 a.m. OK GNU C++11 TESTS 79 31 204800 2900
62399795 ffffxk F Oct. 12, 2019, 6:58 a.m. OK GNU C++11 TESTS 79 31 819200 2900
24134290 PK_PRANTO F Jan. 25, 2017, 6:09 p.m. OK GNU C++11 TESTS 79 31 2560000 2900
64347875 TiwAirOAO F Nov. 6, 2019, 7:09 a.m. OK GNU C++11 TESTS 79 31 16691200 2900
64347845 vjudge3 F Nov. 6, 2019, 7:08 a.m. OK GNU C++11 TESTS 79 31 16691200 2900
51004779 Hzyuer F March 8, 2019, 8:44 a.m. OK GNU C++11 TESTS 79 46 204800 2900
53184589 DeaphetS F April 23, 2019, 9:34 a.m. OK GNU C++11 TESTS 79 46 614400 2900
24128800 eddy1021 F Jan. 25, 2017, 4:19 p.m. OK GNU C++11 TESTS 79 46 2560000 2900
24288584 syc1999 F Jan. 31, 2017, 11:37 a.m. OK GNU C++11 TESTS 79 46 2969600 2900
61344180 sunnuozhou F Sept. 27, 2019, 3:06 a.m. OK GNU C++11 TESTS 79 78 614400 2900
24131817 Al.Cash F Jan. 25, 2017, 5:03 p.m. OK GNU C++14 TESTS 79 30 2252800 2900
62392980 Cyanic F Oct. 12, 2019, 3:41 a.m. OK GNU C++14 TESTS 79 31 614400 2900
24221857 Los_Angelos_Laycurse F Jan. 28, 2017, 10:25 a.m. OK GNU C++14 TESTS 79 31 2355200 2900
24441634 weak_informatics F Feb. 4, 2017, 9:09 p.m. OK GNU C++14 TESTS 79 31 2560000 2900
24441623 weak_informatics F Feb. 4, 2017, 9:08 p.m. OK GNU C++14 TESTS 79 31 2560000 2900
60413708 linus509 F Sept. 12, 2019, 12:19 a.m. OK GNU C++14 TESTS 79 31 33894400 2900
24449511 NiroBC F Feb. 5, 2017, 11:09 a.m. OK GNU C++14 TESTS 79 31 94515200 2900
62451279 Bartholomew F Oct. 13, 2019, 4:18 a.m. OK GNU C++14 TESTS 79 46 716800 2900
24215366 nursultan2002 F Jan. 28, 2017, 5:53 a.m. OK GNU C++14 TESTS 79 124 3481600 2900
62461431 GJC_xj F Oct. 13, 2019, 8:23 a.m. OK GNU C++14 TESTS 79 140 264704000 2900
59057954 vjudge5 F Aug. 18, 2019, 7:49 p.m. OK GNU C++17 TESTS 79 46 66048000 2900
50047289 kczno1 F Feb. 17, 2019, 6:35 a.m. OK GNU C++17 TESTS 79 46 129433600 2900
50047247 kczno1 F Feb. 17, 2019, 6:34 a.m. OK GNU C++17 TESTS 79 61 129740800 2900
62449327 mysterynoip F Oct. 13, 2019, 2:47 a.m. OK GNU C++17 TESTS 79 93 1024000 2900
62460465 feluamn F Oct. 13, 2019, 8:04 a.m. OK GNU C++17 TESTS 79 202 17715200 2900
62557831 slzxchy F Oct. 14, 2019, 11:08 a.m. OK GNU C++17 TESTS 79 218 204800 2900
62503462 __JuRuo F Oct. 13, 2019, 11:34 a.m. OK GNU C++17 TESTS 79 280 69529600 2900
57161097 Benq F July 16, 2019, 7:08 p.m. OK GNU C++17 TESTS 79 327 2662400 2900
51818964 Medeowex F March 25, 2019, 11:02 a.m. OK GNU C++17 TESTS 79 343 86528000 2900
50224667 AnimaOI F Feb. 20, 2019, 6:48 a.m. OK GNU C++17 TESTS 79 546 27750400 2900
24279959 stevie1024 F Jan. 31, 2017, 12:48 a.m. OK Java 8 TESTS 79 1793 22118400 2900
24221838 Los_Angelos_Laycurse F Jan. 28, 2017, 10:24 a.m. OK MS C++ TESTS 79 46 2355200 2900
24128590 sdya F Jan. 25, 2017, 4:17 p.m. OK MS C++ TESTS 79 343 2355200 2900

remove filters

Back to search problems