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
( 1643 ) F1 The Hidden Pair (Easy 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 14 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
84540911 WaAccept F1 June 21, 2020, 2:21 a.m. OK GNU C++11 TESTS 181 61 102400
84539633 wh0816 F1 June 21, 2020, 1:40 a.m. OK GNU C++11 TESTS 181 62 102400
84524787 albeXL F1 June 20, 2020, 7:28 p.m. OK GNU C++11 TESTS 181 62 102400
84494447 WaAccept F1 June 20, 2020, 4:14 p.m. OK GNU C++11 TESTS 181 62 102400
84524199 albeXL F1 June 20, 2020, 7:20 p.m. OK GNU C++11 TESTS 181 62 102400
84540248 cjoa F1 June 21, 2020, 2:02 a.m. OK GNU C++11 TESTS 181 62 204800
84503526 Prabowo F1 June 20, 2020, 4:33 p.m. OK GNU C++11 TESTS 181 62 307200
84539154 gaddopur_coder F1 June 21, 2020, 1:22 a.m. OK GNU C++11 TESTS 181 62 409600
84534402 div24ever F1 June 20, 2020, 10:22 p.m. OK GNU C++11 TESTS 181 62 409600
84504716 21_din_me_paisa_double F1 June 20, 2020, 4:35 p.m. OK GNU C++11 TESTS 181 62 409600
84522894 theBanzaiPredicament F1 June 20, 2020, 7:04 p.m. OK GNU C++14 TESTS 181 61 512000
84534455 AsleepAdhyyan F1 June 20, 2020, 10:23 p.m. OK GNU C++14 TESTS 181 61 716800
84508902 Aldas25 F1 June 20, 2020, 4:44 p.m. OK GNU C++14 TESTS 181 61 8294400
84534208 thebes F1 June 20, 2020, 10:17 p.m. OK GNU C++14 TESTS 181 62 204800
84528033 Kirill22 F1 June 20, 2020, 8:13 p.m. OK GNU C++14 TESTS 181 62 307200
84530086 Fiction F1 June 20, 2020, 8:47 p.m. OK GNU C++14 TESTS 181 62 307200
84530063 ascent F1 June 20, 2020, 8:46 p.m. OK GNU C++14 TESTS 181 62 307200
84522579 nasadigital F1 June 20, 2020, 7 p.m. OK GNU C++14 TESTS 181 62 307200
84518587 shashi_trent F1 June 20, 2020, 6:23 p.m. OK GNU C++14 TESTS 181 62 307200
84518513 s34vv1nd F1 June 20, 2020, 6:22 p.m. OK GNU C++14 TESTS 181 62 307200
84502436 aki167yuuki F1 June 20, 2020, 4:31 p.m. OK GNU C++17 TESTS 181 61 512000
84487704 vepifanov F1 June 20, 2020, 4 p.m. OK GNU C++17 TESTS 181 61 512000
84543779 meopass_0v0 F1 June 21, 2020, 3:34 a.m. OK GNU C++17 TESTS 181 62 307200
84543665 hamburgerwjx F1 June 21, 2020, 3:32 a.m. OK GNU C++17 TESTS 181 62 307200
84542490 hamburgerwjx F1 June 21, 2020, 3:05 a.m. OK GNU C++17 TESTS 181 62 307200
84541567 fakeeverytime F1 June 21, 2020, 2:41 a.m. OK GNU C++17 TESTS 181 62 307200
84541302 ShJ F1 June 21, 2020, 2:33 a.m. OK GNU C++17 TESTS 181 62 307200
84538564 ShJ F1 June 21, 2020, 1 a.m. OK GNU C++17 TESTS 181 62 307200
84538067 VaVshchuck F1 June 21, 2020, 12:42 a.m. OK GNU C++17 TESTS 181 62 307200
84518000 TsunamiNoLetGo F1 June 20, 2020, 6:18 p.m. OK GNU C++17 TESTS 181 62 307200
84542703 AJ47 F1 June 21, 2020, 3:10 a.m. OK GNU C++17 (64) TESTS 181 61 307200
84527646 Prateek F1 June 20, 2020, 8:07 p.m. OK GNU C++17 (64) TESTS 181 61 512000
84533462 errorgorn F1 June 20, 2020, 9:57 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84537664 Phortox F1 June 21, 2020, 12:26 a.m. OK GNU C++17 (64) TESTS 181 62 204800
84537657 Phortox F1 June 21, 2020, 12:25 a.m. OK GNU C++17 (64) TESTS 181 62 204800
84524821 Phortox F1 June 20, 2020, 7:29 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84519755 hoke_t F1 June 20, 2020, 6:32 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84515351 Marckess F1 June 20, 2020, 6:05 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84511954 YouKn0wWho F1 June 20, 2020, 4:48 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84506036 mateusz F1 June 20, 2020, 4:38 p.m. OK GNU C++17 (64) TESTS 181 62 204800
84520228 PizzaLovers007 F1 June 20, 2020, 6:36 p.m. OK Java 11 TESTS 181 234 0
84529837 Hemose F1 June 20, 2020, 8:43 p.m. OK Java 11 TESTS 181 312 0
84535089 pk_sinha53 F1 June 20, 2020, 10:43 p.m. OK Java 11 TESTS 181 358 409600
84483773 SecondThread F1 June 20, 2020, 3:53 p.m. OK Java 11 TESTS 181 373 0
84500489 you.maxwell F1 June 20, 2020, 4:27 p.m. OK Java 11 TESTS 181 390 1228800
84515816 Giantpizzahead F1 June 20, 2020, 6:06 p.m. OK Java 11 TESTS 181 530 0
84535051 ijxjdjd F1 June 20, 2020, 10:42 p.m. OK Java 8 TESTS 181 171 0
84491954 Xylenox F1 June 20, 2020, 4:09 p.m. OK Java 8 TESTS 181 218 0
84524695 YahiaSherif F1 June 20, 2020, 7:27 p.m. OK Java 8 TESTS 181 546 28160000
84519860 golions F1 June 20, 2020, 6:33 p.m. OK Kotlin TESTS 181 202 1331200
84492292 Hakiobo F1 June 20, 2020, 4:09 p.m. OK Kotlin TESTS 181 233 307200
84535161 mban259 F1 June 20, 2020, 10:45 p.m. OK Mono C# TESTS 181 139 6860800
84519044 youx F1 June 20, 2020, 6:26 p.m. OK MS C++ 2017 TESTS 181 62 409600
84493582 pichulia F1 June 20, 2020, 4:12 p.m. OK MS C++ 2017 TESTS 181 77 409600
84537840 reikiriyama F1 June 21, 2020, 12:33 a.m. OK MS C++ 2017 TESTS 181 78 102400
84537856 pikachan14 F1 June 21, 2020, 12:33 a.m. OK MS C++ 2017 TESTS 181 78 102400
84525529 pajenegod F1 June 20, 2020, 7:38 p.m. OK PyPy 2 TESTS 181 249 6041600
84526927 pajenegod F1 June 20, 2020, 7:56 p.m. OK PyPy 2 TESTS 181 249 6144000
84533009 zii.hrs F1 June 20, 2020, 9:48 p.m. OK PyPy 3 TESTS 181 280 7168000
84507760 SPD_9X2 F1 June 20, 2020, 4:42 p.m. OK PyPy 3 TESTS 181 421 9420800
84516180 Mangooste F1 June 20, 2020, 6:08 p.m. OK PyPy 3 TESTS 181 686 35123200
84523580 Mangooste F1 June 20, 2020, 7:12 p.m. OK PyPy 3 TESTS 181 748 35635200
84523973 Mangooste F1 June 20, 2020, 7:17 p.m. OK PyPy 3 TESTS 181 920 35840000
84520925 sh1194 F1 June 20, 2020, 6:43 p.m. OK Python 3 TESTS 181 218 1024000
84520743 sh1194 F1 June 20, 2020, 6:41 p.m. OK Python 3 TESTS 181 218 1024000
84520121 sh1194 F1 June 20, 2020, 6:35 p.m. OK Python 3 TESTS 181 218 1126400
84520533 sh1194 F1 June 20, 2020, 6:39 p.m. OK Python 3 TESTS 181 233 1126400
84517532 MyK_00L F1 June 20, 2020, 6:15 p.m. OK Rust TESTS 181 202 6348800

remove filters

Back to search problems