Codeforces Round 973 (Div. 2)

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
2013 Codeforces Round 973 (Div. 2) FINISHED False 7200 49562723 Sept. 20, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 650 ) F1 Game in Tree (Easy Version) PROGRAMMING binary search data structures games implementation trees

This is the easy version of the problem. In this version, (\mathbf{u = v}). You can make hacks only if both versions of the problem are solved. Alice and Bob are playing a fun game on a tree. This game is played on a tree with (n) vertices, numbered from (1) to (n). Recall that a tree with (n) vertices is an undirected connected graph with (n - 1) edges. Alice and Bob take turns, with Alice going first. Each player starts at some vertex. On their turn, a player must move from the current vertex to a neighboring vertex that has not yet been visited by anyone. The first player who cannot make a move loses. You are given two vertices (u) and (v). Represent the simple path from vertex (u) to (v) as an array (p_1, p_2, p_3, \ldots, p_m), where (p_1 = u), (p_m = v), and there is an edge between (p_i) and (p_{i + 1}) for all (i) ((1 \le i < m)). You need to determine the winner of the game if Alice starts at vertex (1) and Bob starts at vertex (p_j) for each (j) (where (1 \le j \le m)). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 2 \cdot 10^5)) — the number of vertices in the tree. Each of the following (n - 1) lines contains two integers (a) and (b) ((1 \le a, b \le n)), denoting an undirected edge between vertices (a) and (b). It is guaranteed that these edges form a tree. The last line of each test case contains two integers (u) and (v) ((2 \le u, v \le n), (\mathbf{u = v})). It is guaranteed that the path from (u) to (v) does not pass through vertex (1). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output (m) lines. In the (i)-th line, print th

Tutorials

134298

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
282147003 zzfzzfzzfs F1 Sept. 21, 2024, 2:53 a.m. OK C++17 (GCC 7-32) TESTS 51 156 15769600
282130493 akritovandrey F1 Sept. 20, 2024, 9:08 p.m. OK C++17 (GCC 7-32) TESTS 51 281 92467200
282100468 cow8cow F1 Sept. 20, 2024, 4:32 p.m. OK C++17 (GCC 7-32) TESTS 51 296 28672000
282126288 ShirayukiNoa F1 Sept. 20, 2024, 8:14 p.m. OK C++17 (GCC 7-32) TESTS 51 312 23961600
282154118 vrooooom F1 Sept. 21, 2024, 4:28 a.m. OK C++17 (GCC 7-32) TESTS 51 327 34611200
282126146 yueyuanzhiyyz F1 Sept. 20, 2024, 8:13 p.m. OK C++17 (GCC 7-32) TESTS 51 342 77721600
282110226 JeffreyLC F1 Sept. 20, 2024, 5:57 p.m. OK C++17 (GCC 7-32) TESTS 51 343 37068800
282140873 KUHYAKU F1 Sept. 21, 2024, 1:04 a.m. OK C++17 (GCC 7-32) TESTS 51 359 151142400
282110907 JeffreyLC F1 Sept. 20, 2024, 6:01 p.m. OK C++17 (GCC 7-32) TESTS 51 374 36966400
282136710 msm17 F1 Sept. 20, 2024, 11:14 p.m. OK C++17 (GCC 7-32) TESTS 51 389 48230400
282099089 gortomi F1 Sept. 20, 2024, 4:30 p.m. OK C++20 (GCC 13-64) TESTS 51 249 35123200
282111805 kotatsugame F1 Sept. 20, 2024, 6:07 p.m. OK C++20 (GCC 13-64) TESTS 51 249 36249600
282101368 Kude F1 Sept. 20, 2024, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 51 249 36352000
282146007 your_submissions_ F1 Sept. 21, 2024, 2:37 a.m. OK C++20 (GCC 13-64) TESTS 51 249 63897600
282113583 Misuki F1 Sept. 20, 2024, 6:19 p.m. OK C++20 (GCC 13-64) TESTS 51 264 32256000
282131894 gustavocruz F1 Sept. 20, 2024, 9:31 p.m. OK C++20 (GCC 13-64) TESTS 51 265 26828800
282134593 gustavocruz F1 Sept. 20, 2024, 10:24 p.m. OK C++20 (GCC 13-64) TESTS 51 265 31027200
282102541 noya2 F1 Sept. 20, 2024, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 51 265 38092800
282139099 AryRDW F1 Sept. 21, 2024, 12:22 a.m. OK C++20 (GCC 13-64) TESTS 51 265 38400000
282160404 invertedwinger F1 Sept. 21, 2024, 5:46 a.m. OK C++20 (GCC 13-64) TESTS 51 265 46899200
282161715 SparshMittal F1 Sept. 21, 2024, 6 a.m. OK C++23 (GCC 14-64, msys2) TESTS 51 249 50483200
282117570 _MASSIMO_ F1 Sept. 20, 2024, 6:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 51 281 53145600
282149713 molongdadi F1 Sept. 21, 2024, 3:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 51 1249 31436800
282147346 xxh1999 F1 Sept. 21, 2024, 2:58 a.m. OK PyPy 3-64 TESTS 51 499 58982400
282151913 shuyefan F1 Sept. 21, 2024, 4:02 a.m. OK PyPy 3-64 TESTS 51 1421 161484800

remove filters

Back to search problems