Codeforces Round 960 (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
1990 Codeforces Round 960 (Div. 2) FINISHED False 7200 15693863 July 20, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 967 ) E1 Catch the Mole(Easy Version) PROGRAMMING binary search constructive algorithms data structures interactive trees

B'This is the easy version of the problem. The only difference is the limit on the number of queries. This is an interactive problem. You are given a tree of n nodes with node 1 as its root node. There is a hidden mole in one of the nodes. To find its position, you can pick an integer x ( 1 <= x <= n ) to make an inquiry to the jury. Next, the jury will return 1 when the mole is in subtree x . Otherwise, the judge will return 0 . If the judge returns 0 and the mole is not in root node 1 , the mole will move to the parent node of the node it is currently on. Use at most 300 operations to find the current node where the mole is located. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). The description of the test cases follows. The first line of each test case contains one integer n ( 2 <= n <= 5000 ). The following n-1 lines describe the edges of the tree. Each line contains two space-separated integers u_i and v_i ( 1 <= u_i, v_i <= n ), indicating an edge between nodes u_i and v_i . It is guaranteed that the input data represents a tree. The interactor in this task is not adaptive. In other words, the node where the mole is located at first is fixed in every test case and does not change during the interaction. To ask a query, you need to pick a vertex x ( 1 <= x <= n ) and print the line of the following form: After that, you receive: You can make at most 300 queries of this form for each test case. Next, if your program has found the current node where the mole is located, print the line of the following form: Note that this line is not considered a query and is not taken into account when counting the number of queries asked. After this, proceed to the next test case. If you make more than 300 queries during an interaction, your program must terminate immed'...

Tutorials

Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
271684843 LeftLucyCyocson E1 July 21, 2024, 2:13 a.m. OK C++14 (GCC 6-32) TESTS 152 890 52428800
271684534 LeftLucyCyocson E1 July 21, 2024, 2:08 a.m. OK C++14 (GCC 6-32) TESTS 152 968 52326400
271633349 Guslix E1 July 20, 2024, 4:34 p.m. OK C++14 (GCC 6-32) TESTS 149 1000 102400
271698107 david_tao E1 July 21, 2024, 5:15 a.m. OK C++14 (GCC 6-32) TESTS 152 1015 204800
271690526 Rigel__ E1 July 21, 2024, 3:33 a.m. OK C++14 (GCC 6-32) TESTS 152 1031 204800
271674312 antguz E1 July 20, 2024, 10:30 p.m. OK C++14 (GCC 6-32) TESTS 152 1046 102400
271658244 omeganot E1 July 20, 2024, 7:42 p.m. OK C++14 (GCC 6-32) TESTS 150 1046 102400
271687204 ethandong E1 July 21, 2024, 2:49 a.m. OK C++14 (GCC 6-32) TESTS 152 1046 1638400
271697807 david_tao E1 July 21, 2024, 5:11 a.m. OK C++14 (GCC 6-32) TESTS 152 1061 204800
271690907 Hardy_Lee E1 July 21, 2024, 3:38 a.m. OK C++14 (GCC 6-32) TESTS 152 1139 204800
271658942 TooTrashyToCompete E1 July 20, 2024, 7:49 p.m. OK C++17 (GCC 7-32) TESTS 152 921 204800
271658949 bary E1 July 20, 2024, 7:49 p.m. OK C++17 (GCC 7-32) TESTS 152 921 307200
271633376 smalyarovsky E1 July 20, 2024, 4:34 p.m. OK C++17 (GCC 7-32) TESTS 149 937 10035200
271674495 SpinSpen E1 July 20, 2024, 10:34 p.m. OK C++17 (GCC 7-32) TESTS 152 968 102400
271653871 AndrewSeven E1 July 20, 2024, 7:01 p.m. OK C++17 (GCC 7-32) TESTS 150 968 6758400
271644325 ltf0501 E1 July 20, 2024, 5:53 p.m. OK C++17 (GCC 7-32) TESTS 149 983 102400
271649417 Kilani E1 July 20, 2024, 6:24 p.m. OK C++17 (GCC 7-32) TESTS 150 983 204800
271645398 sgc_KrySF E1 July 20, 2024, 5:59 p.m. OK C++17 (GCC 7-32) TESTS 149 984 3276800
271680383 Luca E1 July 21, 2024, 12:55 a.m. OK C++17 (GCC 7-32) TESTS 152 999 204800
271697034 SoiMae E1 July 21, 2024, 5:01 a.m. OK C++17 (GCC 7-32) TESTS 152 1000 1024000
271689167 Moeebius E1 July 21, 2024, 3:17 a.m. OK C++20 (GCC 13-64) TESTS 152 858 204800
271645364 ikaurov E1 July 20, 2024, 5:59 p.m. OK C++20 (GCC 13-64) TESTS 149 858 204800
271651264 Lucina E1 July 20, 2024, 6:38 p.m. OK C++20 (GCC 13-64) TESTS 150 874 18124800
271683677 LOOP0 E1 July 21, 2024, 1:53 a.m. OK C++20 (GCC 13-64) TESTS 152 875 45158400
271692668 yudati E1 July 21, 2024, 4 a.m. OK C++20 (GCC 13-64) TESTS 152 890 102400
271686305 Mango2011 E1 July 21, 2024, 2:36 a.m. OK C++20 (GCC 13-64) TESTS 152 890 204800
271646383 nothing_lasts_forever E1 July 20, 2024, 6:04 p.m. OK C++20 (GCC 13-64) TESTS 150 890 8908800
271675549 MarcosK E1 July 20, 2024, 10:56 p.m. OK C++20 (GCC 13-64) TESTS 152 905 204800
271701137 WTR2007 E1 July 21, 2024, 5:49 a.m. OK C++20 (GCC 13-64) TESTS 152 905 409600
271695768 xiojoy E1 July 21, 2024, 4:42 a.m. OK C++20 (GCC 13-64) TESTS 152 906 102400
271686639 supersonicdandelion E1 July 21, 2024, 2:40 a.m. OK GNU C11 TESTS 152 1187 17715200
271653611 Dukkha E1 July 20, 2024, 6:59 p.m. OK Java 21 TESTS 150 2109 3481600
271641354 profchi E1 July 20, 2024, 5:40 p.m. OK Java 8 TESTS 149 1562 1843200
271646176 jvmusin E1 July 20, 2024, 6:03 p.m. OK Kotlin 1.9 TESTS 150 2546 3072000
271641270 toor E1 July 20, 2024, 5:40 p.m. OK Rust 2021 TESTS 149 1046 102400
271685953 supersonicdandelion E1 July 21, 2024, 2:30 a.m. OK Rust 2021 TESTS 152 3561 102400

remove filters

Back to search problems