Codeforces Round 629 (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
1328 Codeforces Round 629 (Div. 3) FINISHED False 7200 152119511 March 26, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9946 ) E Tree Queries PROGRAMMING dfs and similar graphs trees 2100

B'You are given a rooted tree consisting of n vertices numbered from 1 to n . The root of the tree is a vertex number 1 . A tree is a connected undirected graph with n-1 edges. You are given m queries. The i -th query consists of the set of k_i distinct vertices v_i[1], v_i[2], ... , v_i[k_i] . Your task is to say if there is a path from the root to some vertex u such that each of the given k vertices is either belongs to this path or has the distance 1 to some vertex of this path. The first line of the input contains two integers n and m ( 2 <= n <= 2 cdot 10^5 , 1 <= m <= 2 cdot 10^5 ) -- the number of vertices in the tree and the number of queries. Each of the next n-1 lines describes an edge of the tree. Edge i is denoted by two integers u_i and v_i , the labels of vertices it connects (1 <= u_i, v_i <= n, u_i ne v_i ). It is guaranteed that the given edges form a tree. The next m lines describe queries. The i -th line describes the i -th query and starts with the integer k_i ( 1 <= k_i <= n ) -- the number of vertices in the current query. Then k_i integers follow: v_i[1], v_i[2], ... , v_i[k_i] ( 1 <= v_i[j] <= n ), where v_i[j] is the j -th vertex of the i -th query. It is guaranteed that all vertices in a single query are distinct. It is guaranteed that the sum of k_i does not exceed 2 cdot 10^5 ( sum limits_{i=1}^{m} k_i <= 2 cdot 10^5 ). For each query, print the answer -- "YES", if there is a path from the root to some vertex u such that each of the given k vertices is either belongs to this path or has the distance 1 to some vertex of this path and "NO" otherwise. The picture corresponding to the example: Consider the queries. The first query is [3, 8, 9, 10] . The answer is "YES" as you can choose the path from t'...

Tutorials

75246

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
74496780 rainboy E March 26, 2020, 6:29 p.m. OK GNU C11 TESTS 104 763 13619200 2100
74483454 pengin_2000 E March 26, 2020, 4:45 p.m. OK GNU C11 TESTS 104 1731 32051200 2100
74573297 luogu_bot4 E March 27, 2020, 3:19 p.m. OK GNU C++11 TESTS 104 77 14438400 2100
74516167 luogu_bot5 E March 27, 2020, 12:54 a.m. OK GNU C++11 TESTS 104 78 14438400 2100
74520802 froggyzhang E March 27, 2020, 3:03 a.m. OK GNU C++11 TESTS 104 78 16793600 2100
74474801 songhn E March 26, 2020, 4:22 p.m. OK GNU C++11 TESTS 104 93 18432000 2100
74522963 prodipdatta7 E March 27, 2020, 3:51 a.m. OK GNU C++11 TESTS 104 109 18944000 2100
74557589 OIerwanhong E March 27, 2020, 12:35 p.m. OK GNU C++11 TESTS 104 109 28876800 2100
74534390 prodipdatta7 E March 27, 2020, 7:49 a.m. OK GNU C++11 TESTS 104 124 18944000 2100
74517556 I_Love_xsl E March 27, 2020, 1:37 a.m. OK GNU C++11 TESTS 104 124 30617600 2100
74540215 _Rikka E March 27, 2020, 9:08 a.m. OK GNU C++11 TESTS 104 139 14438400 2100
74549865 LKP1111 E March 27, 2020, 10:56 a.m. OK GNU C++11 TESTS 104 140 19251200 2100
74521057 iamhpp E March 27, 2020, 3:09 a.m. OK GNU C++14 TESTS 104 202 15974400 2100
74520957 iamhpp E March 27, 2020, 3:06 a.m. OK GNU C++14 TESTS 104 202 15974400 2100
74521104 iamhpp E March 27, 2020, 3:10 a.m. OK GNU C++14 TESTS 104 218 15974400 2100
74587358 tj-black E March 27, 2020, 5:59 p.m. OK GNU C++14 TESTS 104 218 22323200 2100
74546113 ankit_2305 E March 27, 2020, 10:14 a.m. OK GNU C++14 TESTS 104 218 28262400 2100
74500338 hsnavarro E March 26, 2020, 7:11 p.m. OK GNU C++14 TESTS 104 233 18329600 2100
74537946 ElyesChaabouni E March 27, 2020, 8:40 a.m. OK GNU C++14 TESTS 104 233 22118400 2100
74566272 abhi2402 E March 27, 2020, 2:06 p.m. OK GNU C++14 TESTS 104 233 22323200 2100
74547212 alexander86 E March 27, 2020, 10:26 a.m. OK GNU C++14 TESTS 104 233 24985600 2100
74551884 Quuns E March 27, 2020, 11:22 a.m. OK GNU C++14 TESTS 104 233 72089600 2100
74515369 _andyli E March 27, 2020, 12:29 a.m. OK GNU C++17 TESTS 104 78 18944000 2100
74482423 _andyli E March 26, 2020, 4:39 p.m. OK GNU C++17 TESTS 104 93 18944000 2100
74535897 ACtowards E March 27, 2020, 8:15 a.m. OK GNU C++17 TESTS 104 139 20480000 2100
74587105 .tx E March 27, 2020, 5:56 p.m. OK GNU C++17 TESTS 104 140 25497600 2100
74535380 CitricAcid E March 27, 2020, 8:08 a.m. OK GNU C++17 TESTS 104 202 15257600 2100
74533039 wish2lucky E March 27, 2020, 6:59 a.m. OK GNU C++17 TESTS 104 202 17612800 2100
74523801 cjmHK E March 27, 2020, 4:09 a.m. OK GNU C++17 TESTS 104 202 17612800 2100
74570000 whynotac E March 27, 2020, 2:44 p.m. OK GNU C++17 TESTS 104 202 18432000 2100
74550233 ks3rr E March 27, 2020, 11:02 a.m. OK GNU C++17 TESTS 104 202 18432000 2100
74550653 Soren_15 E March 27, 2020, 11:07 a.m. OK GNU C++17 TESTS 104 202 18432000 2100
74577906 Vax E March 27, 2020, 4:09 p.m. OK GNU C++17 (64) TESTS 104 218 32563200 2100
74498127 nikitagolu8ev E March 26, 2020, 6:44 p.m. OK GNU C++17 (64) TESTS 104 234 27750400 2100
74515238 pseuda E March 27, 2020, 12:25 a.m. OK GNU C++17 (64) TESTS 104 264 55091200 2100
74520159 thtsshz_bgwrswh E March 27, 2020, 2:49 a.m. OK GNU C++17 (64) TESTS 104 280 41676800 2100
74490755 harshit15 E March 26, 2020, 5:30 p.m. OK GNU C++17 (64) TESTS 104 280 46899200 2100
74491184 harshit15 E March 26, 2020, 5:34 p.m. OK GNU C++17 (64) TESTS 104 280 46899200 2100
74491517 TselmegKh E March 26, 2020, 5:38 p.m. OK GNU C++17 (64) TESTS 104 280 50995200 2100
74503483 Racer5x E March 26, 2020, 7:51 p.m. OK GNU C++17 (64) TESTS 104 295 62771200 2100
74485980 sharmajatin741 E March 26, 2020, 4:59 p.m. OK GNU C++17 (64) TESTS 104 296 33075200 2100
74510370 mohmahkho E March 26, 2020, 9:56 p.m. OK GNU C++17 (64) TESTS 104 296 48332800 2100
74482800 jenish9599 E March 26, 2020, 4:41 p.m. OK Java 11 TESTS 104 483 52838400 2100
74564685 jaynils E March 27, 2020, 1:51 p.m. OK Java 11 TESTS 104 764 94003200 2100
74480183 TheSawan E March 26, 2020, 4:32 p.m. OK Java 11 TESTS 104 997 88985600 2100
74493860 Safayat007 E March 26, 2020, 6 p.m. OK Java 11 TESTS 104 1138 183296000 2100
74484134 GiantTornado E March 26, 2020, 4:48 p.m. OK Java 11 TESTS 104 1481 159846400 2100
74566261 kashishsingh8700 E March 27, 2020, 2:06 p.m. OK Java 11 TESTS 104 1497 53248000 2100
74548513 cribabby E March 27, 2020, 10:39 a.m. OK Java 11 TESTS 104 1809 105062400 2100
74548387 low_cg E March 27, 2020, 10:38 a.m. OK Java 11 TESTS 104 1809 105062400 2100
74496025 In_The_Name_Of_Love E March 26, 2020, 6:21 p.m. OK Java 8 TESTS 104 374 16691200 2100
74512222 fetetriste E March 26, 2020, 10:48 p.m. OK Java 8 TESTS 104 389 50688000 2100
74588413 IBatJ E March 27, 2020, 6:12 p.m. OK Java 8 TESTS 104 421 56422400 2100
74557865 amolpratap007 E March 27, 2020, 12:38 p.m. OK Java 8 TESTS 104 421 58982400 2100
74540615 bhautik_77 E March 27, 2020, 9:12 a.m. OK Java 8 TESTS 104 436 58777600 2100
74534830 maheshwari29 E March 27, 2020, 8:01 a.m. OK Java 8 TESTS 104 467 58368000 2100
74535000 maheshwari29 E March 27, 2020, 8:03 a.m. OK Java 8 TESTS 104 498 58368000 2100
74502332 nayanava.de01 E March 26, 2020, 7:36 p.m. OK Java 8 TESTS 104 545 45568000 2100
74511254 EndlessVoid E March 26, 2020, 10:18 p.m. OK Java 8 TESTS 104 545 47923200 2100
74490578 jxin31415 E March 26, 2020, 5:29 p.m. OK Java 8 TESTS 104 561 40243200 2100
74534509 Hakiobo E March 27, 2020, 7:55 a.m. OK Kotlin TESTS 104 545 47001600 2100
74533445 Hakiobo E March 27, 2020, 7:10 a.m. OK Kotlin TESTS 104 701 33177600 2100
74584122 yevhenii_kanivets E March 27, 2020, 5:22 p.m. OK Kotlin TESTS 104 732 67276800 2100
74508766 Hakiobo E March 26, 2020, 9:19 p.m. OK Kotlin TESTS 104 1014 84582400 2100
74508131 Hakiobo E March 26, 2020, 9:07 p.m. OK Kotlin TESTS 104 1060 94412800 2100
74564978 SlavaG E March 27, 2020, 1:53 p.m. OK Kotlin TESTS 104 1060 97792000 2100
74507730 Hakiobo E March 26, 2020, 9 p.m. OK Kotlin TESTS 104 1091 81715200 2100
74499268 mban259 E March 26, 2020, 6:57 p.m. OK Mono C# TESTS 104 1294 70451200 2100
74541547 vjudge5 E March 27, 2020, 9:23 a.m. OK MS C++ TESTS 104 1216 30515200 2100
74469749 CrashMaster E March 26, 2020, 4:13 p.m. OK MS C++ 2017 TESTS 104 327 15769600 2100
74562719 LeeLdler E March 27, 2020, 1:31 p.m. OK MS C++ 2017 TESTS 104 389 36352000 2100
74482978 youx E March 26, 2020, 4:42 p.m. OK MS C++ 2017 TESTS 104 498 31948800 2100
74547650 Najmus_Sakib_Rashid E March 27, 2020, 10:31 a.m. OK MS C++ 2017 TESTS 104 499 24064000 2100
74575066 ilya_totl E March 27, 2020, 3:37 p.m. OK MS C++ 2017 TESTS 104 654 25907200 2100
74546933 q8514199 E March 27, 2020, 10:23 a.m. OK MS C++ 2017 TESTS 104 748 29388800 2100
74549826 60D9 E March 27, 2020, 10:56 a.m. OK MS C++ 2017 TESTS 104 1247 16076800 2100
74568198 getN1ght E March 27, 2020, 2:26 p.m. OK MS C++ 2017 TESTS 104 1294 21401600 2100
74570008 mrx_slm E March 27, 2020, 2:44 p.m. OK MS C++ 2017 TESTS 104 1340 15769600 2100
74569022 mrx_slm E March 27, 2020, 2:34 p.m. OK MS C++ 2017 TESTS 104 1357 16588800 2100
74567395 kabeer27 E March 27, 2020, 2:18 p.m. OK PyPy 2 TESTS 104 1326 60825600 2100
74561691 kabeer27 E March 27, 2020, 1:21 p.m. OK PyPy 2 TESTS 104 1357 67891200 2100
74567076 kabeer27 E March 27, 2020, 2:14 p.m. OK PyPy 2 TESTS 104 1466 69836800 2100
74566852 kabeer27 E March 27, 2020, 2:12 p.m. OK PyPy 2 TESTS 104 1512 69632000 2100
74588292 _comfortably_numb E March 27, 2020, 6:11 p.m. OK PyPy 3 TESTS 104 997 44851200 2100
74523248 mkawa2 E March 27, 2020, 3:57 a.m. OK PyPy 3 TESTS 104 1028 47820800 2100
74542698 aberent E March 27, 2020, 9:36 a.m. OK PyPy 3 TESTS 104 1029 69222400 2100
74565082 Crescent617 E March 27, 2020, 1:55 p.m. OK PyPy 3 TESTS 104 1060 33996800 2100
74520019 Coki628 E March 27, 2020, 2:45 a.m. OK PyPy 3 TESTS 104 1185 50892800 2100
74509739 throwawayatcoder E March 26, 2020, 9:41 p.m. OK PyPy 3 TESTS 104 1200 111411200 2100
74533463 Coki628 E March 27, 2020, 7:11 a.m. OK PyPy 3 TESTS 104 1310 50176000 2100
74504324 Dart-Xeyter E March 26, 2020, 8:04 p.m. OK PyPy 3 TESTS 104 1326 195686400 2100
74523819 HeavensC E March 27, 2020, 4:10 a.m. OK PyPy 3 TESTS 104 1341 86732800 2100
74531955 MAO1112 E March 27, 2020, 6:44 a.m. OK PyPy 3 TESTS 104 1419 92057600 2100
74532707 MAO1112 E March 27, 2020, 6:53 a.m. OK Python 3 TESTS 104 1809 56012800 2100
74541763 MAO1112 E March 27, 2020, 9:26 a.m. OK Python 3 TESTS 104 1840 56012800 2100
74495099 potpath E March 26, 2020, 6:11 p.m. OK Python 3 TESTS 104 1980 44339200 2100
74504270 sansen E March 26, 2020, 8:03 p.m. OK Rust TESTS 104 265 23654400 2100
74486316 akiradeveloper E March 26, 2020, 5:01 p.m. OK Rust TESTS 104 296 39628800 2100
74484089 rustafarian E March 26, 2020, 4:48 p.m. OK Rust TESTS 104 358 25292800 2100
74566610 limed E March 27, 2020, 2:10 p.m. OK Scala TESTS 104 935 71577600 2100

remove filters

Back to search problems