Codeforces Round 606 (Div. 1, based on Technocup 2020 Elimination Round 4)

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
1276 Codeforces Round 606 (Div. 1, based on Technocup 2020 Elimination Round 4) FINISHED False 7200 200084123 Dec. 14, 2019, 11:05 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 671 ) D Tree Elimination PROGRAMMING dp trees 2600

Vasya has a tree with n vertices numbered from 1 to n , and n - 1 edges numbered from 1 to n - 1 . Initially each vertex contains a token with the number of the vertex written on it. Vasya plays a game. He considers all edges of the tree by increasing of their indices. For every edge he acts as follows: The result of the game is the sequence of numbers Vasya has written down. Note that there may be many possible resulting sequences depending on the choice of endpoints when tokens are removed. Vasya has played for such a long time that he thinks he exhausted all possible resulting sequences he can obtain. He wants you to verify him by computing the number of distinct sequences modulo 998 ,244 ,353 . The first line contains a single integer n ( 2 <= q n <= q 2 cdot 10^5 ) -- the number of vertices of the tree. The next n - 1 lines describe edges of the tree. The i -th of these lines contains two integers u_i, v_i ( 1 <= q u_i, v_i <= q n ) -- endpoints of the edge with index i . It is guaranteed that the given graph is indeed a tree. Print a single integer -- the number of distinct sequences modulo 998 ,244 ,353 . In the first sample case the distinct sequences are (1), (2, 1), (2, 3, 1), (2, 3, 4, 1), (2, 3, 4, 5) . Int the second sample case the distinct sequences are (2, 6, 5, 3), (2, 6, 5, 7), (2, 6, 7, 2), (2, 6, 7, 5), (2, 7, 3), (2, 7, 5), (7, 1, 3), (7, 1, 5), (7, 2, 3), (7, 2, 5) .

Tutorials

Technocup 2020 — Elimination Round 4 + Codeforces Round 606: Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
66873781 LJC00118 D Dec. 14, 2019, 2:21 p.m. OK GNU C++11 TESTS 23 78 23142400 2600
66997276 Isonan D Dec. 16, 2019, 3:03 a.m. OK GNU C++11 TESTS 23 93 19148800 2600
66876846 stal_xy23z7b8 D Dec. 14, 2019, 3:13 p.m. OK GNU C++11 TESTS 23 93 21606400 2600
68043702 tyler178 D Jan. 1, 2020, 3:28 p.m. OK GNU C++11 TESTS 23 109 22425600 2600
66968356 Rubblsh12345 D Dec. 15, 2019, 12:29 p.m. OK GNU C++11 TESTS 23 109 24780800 2600
66970257 MoQianXue D Dec. 15, 2019, 1 p.m. OK GNU C++11 TESTS 23 109 25395200 2600
66866182 Lagoon_ D Dec. 14, 2019, 12:54 p.m. OK GNU C++11 TESTS 23 124 20787200 2600
67183437 lhylhy D Dec. 19, 2019, 2:21 a.m. OK GNU C++11 TESTS 23 124 21401600 2600
68690727 liuweih D Jan. 13, 2020, 5:59 a.m. OK GNU C++11 TESTS 23 124 22425600 2600
66863353 Panole233 D Dec. 14, 2019, 12:43 p.m. OK GNU C++11 TESTS 23 124 23961600 2600
66881267 Maripium D Dec. 14, 2019, 4:39 p.m. OK GNU C++14 TESTS 23 171 22425600 2600
67019653 DimmyT D Dec. 16, 2019, 12:34 p.m. OK GNU C++14 TESTS 23 186 31334400 2600
66867792 natsugiri D Dec. 14, 2019, 1 p.m. OK GNU C++14 TESTS 23 187 14745600 2600
67274799 oipotato D Dec. 20, 2019, 9:46 a.m. OK GNU C++14 TESTS 23 202 19558400 2600
67001071 daniel14311531 D Dec. 16, 2019, 5:44 a.m. OK GNU C++14 TESTS 23 202 21708800 2600
66881328 Maripium D Dec. 14, 2019, 4:40 p.m. OK GNU C++14 TESTS 23 202 22425600 2600
67135112 mobu233 D Dec. 18, 2019, 3:37 a.m. OK GNU C++14 TESTS 23 202 25497600 2600
67189550 willingox D Dec. 19, 2019, 6:29 a.m. OK GNU C++14 TESTS 23 202 30412800 2600
67466951 yan-zp D Dec. 23, 2019, 11:25 a.m. OK GNU C++14 TESTS 23 217 23859200 2600
68098614 DmitryGrigorev D Jan. 2, 2020, 11:29 p.m. OK GNU C++14 TESTS 23 217 27033600 2600
68139525 FlowerOfSorrow D Jan. 3, 2020, 9:02 p.m. OK GNU C++17 TESTS 23 171 36761600 2600
66874782 Polygon-yg D Dec. 14, 2019, 2:37 p.m. OK GNU C++17 TESTS 23 171 53248000 2600
66971221 sruthi_1729 D Dec. 15, 2019, 1:15 p.m. OK GNU C++17 TESTS 23 186 27033600 2600
69276665 summitwei D Jan. 22, 2020, 2:44 a.m. OK GNU C++17 TESTS 23 186 29593600 2600
66863170 matthew99 D Dec. 14, 2019, 12:42 p.m. OK GNU C++17 TESTS 23 202 19353600 2600
67021441 Jiburiru D Dec. 16, 2019, 1:04 p.m. OK GNU C++17 TESTS 23 202 19763200 2600
68387779 jiangly D Jan. 8, 2020, 6:56 a.m. OK GNU C++17 TESTS 23 202 21606400 2600
67266712 Maripium D Dec. 20, 2019, 6:29 a.m. OK GNU C++17 TESTS 23 202 22425600 2600
67002787 brandonzhang D Dec. 16, 2019, 6:35 a.m. OK GNU C++17 TESTS 23 202 23347200 2600
69175931 WaluntOvO D Jan. 20, 2020, 8:06 a.m. OK GNU C++17 TESTS 23 202 24985600 2600
67397642 yaoct D Dec. 22, 2019, 1:01 a.m. OK Java 8 TESTS 23 1715 206540800 2600

remove filters

Back to search problems