Codeforces Round 651 (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
1370 Codeforces Round 651 (Div. 2) FINISHED False 8100 144689111 June 20, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1519 ) F2 The Hidden Pair (Hard Version) PROGRAMMING binary search dfs and similar graphs interactive shortest paths trees

B'Note that the only difference between the easy and hard version is the constraint on the number of queries. You can make hacks only if all versions of the problem are solved. This is an interactive problem. You are given a tree consisting of n nodes numbered with integers from 1 to n . Ayush and Ashish chose two secret distinct nodes in the tree. You need to find out both the nodes. You can make the following query: Recall that a tree is a connected graph without cycles. The distance between two nodes is defined as the number of edges in the simple path between them. More formally, let 's define two hidden nodes as s and f . In one query you can provide the set of nodes {a_1, a_2, ldots, a_c } of the tree. As a result, you will get two numbers a_i and dist(a_i, s) + dist(a_i, f) . The node a_i is any node from the provided set, for which the number dist(a_i, s) + dist(a_i, f) is minimal. You can ask no more than 11 queries. The first line contains a single integer t (1 <= q t <= q 10) -- the number of test cases. Please note, how the interaction process is organized. The first line of each test case consists of a single integer n (2 <= n <= 1000) -- the number of nodes in the tree. The next n - 1 lines consist of two integers u , v (1 <= u, v <= n, u ne v) -- the edges of the tree. To ask a query print a single line: For each query, you will receive two integers x , d -- the node (among the queried nodes) with the minimum sum of distances to the hidden nodes and the sum of distances from that node to the hidden nodes. If the subset of nodes queried is invalid or you exceeded the number of queries then you will get x = d = -1 . In this case, you should terminate the program immediately. When you have guessed the hidden nodes, print a single line "! " (without quotes), followed by two integers in the range [1, n] '...

Tutorials

Editorial — Codeforces Round #651

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
84503675 Prabowo F2 June 20, 2020, 4:33 p.m. OK GNU C++11 TESTS 181 61 307200
84536009 AQT F2 June 20, 2020, 11:16 p.m. OK GNU C++11 TESTS 181 62 102400
84539642 wh0816 F2 June 21, 2020, 1:41 a.m. OK GNU C++11 TESTS 181 62 102400
84535885 ajpiano F2 June 20, 2020, 11:11 p.m. OK GNU C++11 TESTS 181 62 102400
84525313 albeXL F2 June 20, 2020, 7:35 p.m. OK GNU C++11 TESTS 181 62 102400
84540194 cjoa F2 June 21, 2020, 2 a.m. OK GNU C++11 TESTS 181 62 204800
84538178 M1v1savva1601 F2 June 21, 2020, 12:46 a.m. OK GNU C++11 TESTS 181 62 307200
84540469 gaddopur_coder F2 June 21, 2020, 2:09 a.m. OK GNU C++11 TESTS 181 77 204800
84540542 gaddopur_coder F2 June 21, 2020, 2:11 a.m. OK GNU C++11 TESTS 181 78 307200
84516224 T1duS F2 June 20, 2020, 6:08 p.m. OK GNU C++11 TESTS 181 78 409600
84534148 thebes F2 June 20, 2020, 10:15 p.m. OK GNU C++14 TESTS 181 62 204800
84516351 sbckvnl F2 June 20, 2020, 6:08 p.m. OK GNU C++14 TESTS 181 62 307200
84522620 nasadigital F2 June 20, 2020, 7:01 p.m. OK GNU C++14 TESTS 181 62 307200
84516268 cscscs F2 June 20, 2020, 6:08 p.m. OK GNU C++14 TESTS 181 62 307200
84511078 sbckvnl F2 June 20, 2020, 4:47 p.m. OK GNU C++14 TESTS 181 62 307200
84481047 tmwilliamlin168 F2 June 20, 2020, 3:48 p.m. OK GNU C++14 TESTS 181 62 409600
84543090 SuperJ6 F2 June 21, 2020, 3:19 a.m. OK GNU C++14 TESTS 181 62 512000
84542732 gohan123 F2 June 21, 2020, 3:11 a.m. OK GNU C++14 TESTS 181 62 512000
84530757 cypherop F2 June 20, 2020, 8:59 p.m. OK GNU C++14 TESTS 181 62 512000
84528044 Kirill22 F2 June 20, 2020, 8:13 p.m. OK GNU C++14 TESTS 181 62 512000
84544062 hamburgerwjx F2 June 21, 2020, 3:40 a.m. OK GNU C++17 TESTS 181 61 307200
84534860 abhinavvv306 F2 June 20, 2020, 10:35 p.m. OK GNU C++17 TESTS 181 61 512000
84515276 StarCuriosity F2 June 20, 2020, 6:05 p.m. OK GNU C++17 TESTS 181 61 512000
84535532 Jonathan_Livingston F2 June 20, 2020, 10:59 p.m. OK GNU C++17 TESTS 181 61 614400
84522531 bekzhan29 F2 June 20, 2020, 7 p.m. OK GNU C++17 TESTS 181 61 716800
84538071 VaVshchuck F2 June 21, 2020, 12:42 a.m. OK GNU C++17 TESTS 181 62 307200
84544015 hamburgerwjx F2 June 21, 2020, 3:39 a.m. OK GNU C++17 TESTS 181 62 307200
84543442 sayeedt F2 June 21, 2020, 3:27 a.m. OK GNU C++17 TESTS 181 62 307200
84537832 HoaPhat1 F2 June 21, 2020, 12:33 a.m. OK GNU C++17 TESTS 181 62 409600
84537815 HoaPhat1 F2 June 21, 2020, 12:32 a.m. OK GNU C++17 TESTS 181 62 409600
84537973 Phortox F2 June 21, 2020, 12:38 a.m. OK GNU C++17 (64) TESTS 181 61 204800
84492401 emthrm F2 June 20, 2020, 4:09 p.m. OK GNU C++17 (64) TESTS 181 61 204800
84524206 swapnil159 F2 June 20, 2020, 7:20 p.m. OK GNU C++17 (64) TESTS 181 61 307200
84482701 ecnerwala F2 June 20, 2020, 3:51 p.m. OK GNU C++17 (64) TESTS 181 62 102400
84541470 Marckess F2 June 21, 2020, 2:38 a.m. OK GNU C++17 (64) TESTS 181 62 204800
84537801 Ernestico F2 June 21, 2020, 12:31 a.m. OK GNU C++17 (64) TESTS 181 62 204800
84535329 errorgorn F2 June 20, 2020, 10:51 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84532634 hoke_t F2 June 20, 2020, 9:39 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84529234 totori0908 F2 June 20, 2020, 8:32 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84517755 YouKn0wWho F2 June 20, 2020, 6:17 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84520414 PizzaLovers007 F2 June 20, 2020, 6:38 p.m. OK Java 11 TESTS 181 249 0
84535106 pk_sinha53 F2 June 20, 2020, 10:43 p.m. OK Java 11 TESTS 181 358 409600
84516935 Giantpizzahead F2 June 20, 2020, 6:11 p.m. OK Java 11 TESTS 181 530 0
84537567 ijxjdjd F2 June 21, 2020, 12:22 a.m. OK Java 8 TESTS 181 171 0
84524724 YahiaSherif F2 June 20, 2020, 7:27 p.m. OK Java 8 TESTS 181 592 28160000
84492610 Hakiobo F2 June 20, 2020, 4:10 p.m. OK Kotlin TESTS 181 202 307200
84535355 mban259 F2 June 20, 2020, 10:52 p.m. OK Mono C# TESTS 181 109 6860800
84537864 pikachan14 F2 June 21, 2020, 12:34 a.m. OK MS C++ 2017 TESTS 181 77 102400
84515777 pichulia F2 June 20, 2020, 6:06 p.m. OK MS C++ 2017 TESTS 181 77 409600
84529903 youx F2 June 20, 2020, 8:44 p.m. OK MS C++ 2017 TESTS 181 77 409600
84537920 reikiriyama F2 June 21, 2020, 12:36 a.m. OK MS C++ 2017 TESTS 181 78 102400
84526900 pajenegod F2 June 20, 2020, 7:56 p.m. OK PyPy 2 TESTS 181 264 6144000
84524747 Mangooste F2 June 20, 2020, 7:28 p.m. OK PyPy 3 TESTS 181 1044 21913600
84517645 MyK_00L F2 June 20, 2020, 6:16 p.m. OK Rust TESTS 181 202 6348800

remove filters

Back to search problems