Codeforces Round 1012 (Div. 1)

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
2089 Codeforces Round 1012 (Div. 1) FINISHED False 9000 37326255 March 23, 2025, 5:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 128 ) E Black Cat Collapse PROGRAMMING

The world of the black cat is collapsing. In this world, which can be represented as a rooted tree with root at node (1), Liki and Sasami need to uncover the truth about the world. Each day, they can explore a node (u) that has not yet collapsed. After this exploration, the black cat causes (u) and all nodes in its subtree to collapse. Additionally, at the end of the (i) th day, if it exists, the number (n-i+1) node will also collapse. For each (i) from (1) to (n), determine the number of exploration schemes where Liki and Sasami explore exactly (i) days (i.e., they perform exactly (i) operations), with the last exploration being at node (1). The result should be computed modulo (998\,244\,353). Note: It is guaranteed that nodes (1) to (n) can form a "DFS" order of the tree, meaning there exists a depth-first search traversal where the (i) th visited node is (i). The first line contains an integer (t) ((1 \le t \le 10)) — the number of test cases. The description of the test cases follows. The first line of each test case contains exactly one number (n) ((3 \le n \le 80)). Each of the following (n - 1) lines contains two integers (u_i) and (v_i), representing two vertices connected by an edge ((1 \le u_i, v_i \le n)). It is guaranteed that the given edges form a tree. It is also guaranteed that the vertices can form a "DFS" traversal order. It is guaranteed that the sum of (n) for all test cases does not exceed (80) For each test case, print (n) integers, where the (i) th integer represents the number of exploration schemes for exactly (i) days, modulo (998\,244\,353). For the first test case, the following operation sequences are legal: (\{1\},\{2,1\},\{3,1\},\{4,1\},\{3,2,1\},\{4,2,1\},\{4,3,1\},\{4,3,2,1\}).

Tutorials

Codeforces Round 1012 (Div.1, Div. 2, based on THUPC 2025 — Finals) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
312142013 Om_patel123 E March 24, 2025, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 43 250 172544000
312106848 khushvantkumar123 E March 23, 2025, 6:09 p.m. OK C++17 (GCC 7-32) TESTS 43 500 240435200
312117803 tourist E March 23, 2025, 8:11 p.m. OK C++20 (GCC 13-64) TESTS 43 264 172544000
312117703 tourist E March 23, 2025, 8:10 p.m. OK C++20 (GCC 13-64) TESTS 43 327 172544000
312026130 tourist E March 23, 2025, 7:51 a.m. OK C++20 (GCC 13-64) TESTS 43 390 240435200
312061513 donghanwen E March 23, 2025, 11:29 a.m. OK C++20 (GCC 13-64) TESTS 43 734 347238400
312027793 jiangly E March 23, 2025, 7:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 125 0
312104781 DevdGamer E March 23, 2025, 5:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 156 102400
312126747 Benq E March 23, 2025, 10:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 421 5632000
312126465 Benq E March 23, 2025, 10:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 43 483 5529600
312062321 lexiyvv E March 23, 2025, 11:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 43 968 209305600

remove filters

Back to search problems