Codeforces Round 1076 (Div. 3)

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
2193 Codeforces Round 1076 (Div. 3) FINISHED False 8100 7053923 Jan. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2204 ) G Paths in a Tree PROGRAMMING dfs and similar interactive sortings trees

This is an interactive problem . In this interactive problem, you are given an acyclic, connected, undirected graph consisting of (n) vertices. We define a path between two vertices (v) and (u) as a sequence of distinct vertices (p_1, p_2,\dots p_k) such that (p_1 = v), (p_k = u), and for all (i) ((1 \le i < k)), there exists an edge between vertices (p_i) and (p_{i+1}). There are hidden vertices (x) and (y) (they may coincide). You can make the following queries: Choose two vertices (a), (b) ((1\le a, b\le n)). The jury will respond with (1) if the path between vertices (x), (y) and the path between vertices (a), (b) share at least one common vertex, and will respond with (0) otherwise. Note that the interactor is adaptive , which means that the hidden vertices may change depending on your queries, but will not contradict previous queries. Each test consists of several test cases. The first line contains one integer (t) ((1\le t\le 10^4)) — the number of test cases. The following lines describe the test cases. The first line of each test case contains one integer (n) ((2\le n\le 2\cdot 10^5)) — the number of vertices in the graph. Next, there are (n - 1) lines, each containing two integers (v), (u) ((1\le v, u\le n)), indicating that vertices (v) and (u) are connected by an edge in the graph. It is guaranteed that the sum of (n) across all test cases does not exceed (2\cdot 10^5). To find any vertex on the path, you can use no more than (\lfloor\frac{n}{2}\rfloor + 1) queries. For this, use queries of the form "? (a) (b)". After each query, read one number, either (0) or (1) — the response to the query. When you find one of the required vertices, output one line in the following format: "! (v)" ((1\le v\le n)), where (v) is the vertex you found. If your program makes more than $$$\lfloor\frac{n

Tutorials

Разбор Codeforces Round 1076 (Div. 3)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359929537 thaibaotran555 G Jan. 26, 2026, 2:26 a.m. OK C++17 (GCC 7-32) TESTS 20 375 10342400
359942405 yashgupta567 G Jan. 26, 2026, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 20 390 102400
359918334 Sorinel G Jan. 25, 2026, 9:21 p.m. OK C++17 (GCC 7-32) TESTS 20 406 28876800
359926341 alternn G Jan. 26, 2026, 1 a.m. OK C++17 (GCC 7-32) TESTS 20 421 3891200
359903030 adityacf02017 G Jan. 25, 2026, 6:32 p.m. OK C++17 (GCC 7-32) TESTS 20 421 10854400
359897820 n_cube G Jan. 25, 2026, 5:58 p.m. OK C++17 (GCC 7-32) TESTS 20 437 5324800
359891403 vito1036 G Jan. 25, 2026, 5:22 p.m. OK C++17 (GCC 7-32) TESTS 20 437 14438400
359907091 Bona_Boss G Jan. 25, 2026, 7:06 p.m. OK C++17 (GCC 7-32) TESTS 20 453 8192000
359883333 bhumika_dangayach G Jan. 25, 2026, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 20 453 9318400
359925511 mowo G Jan. 26, 2026, 12:32 a.m. OK C++17 (GCC 7-32) TESTS 20 453 12288000
359890651 Fushengh G Jan. 25, 2026, 5:18 p.m. OK C++20 (GCC 13-64) TESTS 20 328 44236800
359918719 chrono989 G Jan. 25, 2026, 9:28 p.m. OK C++20 (GCC 13-64) TESTS 20 328 52838400
359929493 TranVinhHuy2010 G Jan. 26, 2026, 2:25 a.m. OK C++20 (GCC 13-64) TESTS 20 359 10547200
359943479 XTray_ G Jan. 26, 2026, 5:47 a.m. OK C++20 (GCC 13-64) TESTS 20 359 25907200
359932108 yuanmouren G Jan. 26, 2026, 3:17 a.m. OK C++20 (GCC 13-64) TESTS 20 359 27443200
359935716 CutSandstone G Jan. 26, 2026, 4:20 a.m. OK C++20 (GCC 13-64) TESTS 20 359 39116800
359889012 Remote_Dream G Jan. 25, 2026, 5:06 p.m. OK C++20 (GCC 13-64) TESTS 20 359 57651200
359910782 ipisscoffee G Jan. 25, 2026, 7:42 p.m. OK C++20 (GCC 13-64) TESTS 20 375 27443200
359916198 _ahmed_tawfik_ G Jan. 25, 2026, 8:47 p.m. OK C++20 (GCC 13-64) TESTS 20 375 34816000
359907208 Ebrafat G Jan. 25, 2026, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 20 375 49766400
359901455 43c65d1 G Jan. 25, 2026, 6:21 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 265 4505600
359919028 VIKAS__SINGH G Jan. 25, 2026, 9:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 296 8294400
359898897 xinlingzy G Jan. 25, 2026, 6:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 312 31744000
359939012 Jahid__Noob G Jan. 26, 2026, 5:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 312 31846400
359931084 shi_logic G Jan. 26, 2026, 2:56 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 328 12902400
359911591 MMO G Jan. 25, 2026, 7:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 328 33792000
359897611 El_Qorsan G Jan. 25, 2026, 5:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 328 33792000
359920102 The_Ruthless G Jan. 25, 2026, 9:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 328 39731200
359896094 Shantanu1058 G Jan. 25, 2026, 5:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 328 48947200
359926050 alternn G Jan. 26, 2026, 12:51 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 343 8601600
359936802 yiren G Jan. 26, 2026, 4:36 a.m. OK Go TESTS 20 468 83148800
359891605 lybord G Jan. 25, 2026, 5:23 p.m. OK Java 21 TESTS 20 843 18124800
359925170 Power_Rangers_ G Jan. 26, 2026, 12:21 a.m. OK Java 21 TESTS 20 1359 73523200
359907226 tin.le2 G Jan. 25, 2026, 7:07 p.m. OK Kotlin 2.2 TESTS 20 1281 111513600
359932707 tin.le2 G Jan. 26, 2026, 3:29 a.m. OK Kotlin 2.2 TESTS 20 1296 111513600
359930306 kamio-misuzu G Jan. 26, 2026, 2:42 a.m. OK PyPy 3-64 TESTS 20 1312 40448000
359916844 kaushik.atla G Jan. 25, 2026, 8:57 p.m. OK PyPy 3-64 TESTS 20 1406 48230400
359892799 fatalerror G Jan. 25, 2026, 5:29 p.m. OK PyPy 3-64 TESTS 20 1468 48537600
359909754 gardengnome G Jan. 25, 2026, 7:31 p.m. OK PyPy 3-64 TESTS 20 1484 27443200
359925796 RobinFromTheHood G Jan. 26, 2026, 12:43 a.m. OK PyPy 3-64 TESTS 20 1484 54784000
359925990 kdy8128 G Jan. 26, 2026, 12:49 a.m. OK PyPy 3-64 TESTS 20 1546 52736000
359890479 smz.26 G Jan. 25, 2026, 5:17 p.m. OK PyPy 3-64 TESTS 20 1562 50278400
359938055 RUTHVIK0811 G Jan. 26, 2026, 4:51 a.m. OK PyPy 3-64 TESTS 20 1593 59904000
359911336 jubaO G Jan. 25, 2026, 7:50 p.m. OK PyPy 3-64 TESTS 20 1734 55193600
359894083 SPD_9X2 G Jan. 25, 2026, 5:36 p.m. OK PyPy 3-64 TESTS 20 1750 47513600
359891651 ericshen19555 G Jan. 25, 2026, 5:23 p.m. OK Python 3 TESTS 20 1609 45465600
359893844 haque_aoyon G Jan. 25, 2026, 5:34 p.m. OK Python 3 TESTS 20 1625 43724800
359935597 najmiddinweb G Jan. 26, 2026, 4:18 a.m. OK Python 3 TESTS 20 1625 72704000
359908811 allenchang2001 G Jan. 25, 2026, 7:22 p.m. OK Rust 2021 TESTS 20 328 22528000
359898288 drydock G Jan. 25, 2026, 6:01 p.m. OK Rust 2024 TESTS 20 312 18534400

remove filters

Back to search problems