Codeforces Round 620 (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
1304 Codeforces Round 620 (Div. 2) FINISHED False 7200 150051299 Feb. 15, 2020, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5299 ) E 1-Trees and Queries PROGRAMMING data structures dfs and similar shortest paths trees 2000

B'Gildong was hiking a mountain, walking by millions of trees. Inspired by them, he suddenly came up with an interesting idea for trees in data structures: What if we add another edge in a tree? Then he found that such tree-like graphs are called 1-trees. Since Gildong was bored of solving too many tree problems, he wanted to see if similar techniques in trees can be used in 1-trees as well. Instead of solving it by himself, he 's going to test you by providing queries on 1-trees. First, he 'll provide you a tree (not 1-tree) with n vertices, then he will ask you q queries. Each query contains 5 integers: x , y , a , b , and k . This means you 're asked to determine if there exists a path from vertex a to b that contains exactly k edges after adding a bidirectional edge between vertices x and y . A path can contain the same vertices and same edges multiple times. All queries are independent of each other; i.e. the added edge in a query is removed in the next query. The first line contains an integer n ( 3 <= n <= 10^5 ), the number of vertices of the tree. Next n-1 lines contain two integers u and v ( 1 <= u,v <= n , u ne v ) each, which means there is an edge between vertex u and v . All edges are bidirectional and distinct. Next line contains an integer q ( 1 <= q <= 10^5 ), the number of queries Gildong wants to ask. Next q lines contain five integers x , y , a , b , and k each ( 1 <= x,y,a,b <= n , x ne y , 1 <= k <= 10^9 ) xe2 x80 x93 the integers explained in the description. It is guaranteed that the edge between x and y does not exist in the original tree. For each query, print "YES" if there exists a path that contains exactly k edges from vertex a to b after adding an edge between vertices x and y . Otherwise, print "NO". You can prin'...

Tutorials

Codeforces Round #620 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
71614316 JWoong149 E Feb. 22, 2020, 1:31 p.m. OK Clang++17 Diagnostics TESTS 94 3587 70860800 2000
71614200 JWoong149 E Feb. 22, 2020, 1:29 p.m. OK Clang++17 Diagnostics TESTS 94 3650 70860800 2000
71613737 JWoong149 E Feb. 22, 2020, 1:21 p.m. OK Clang++17 Diagnostics TESTS 94 3821 54886400 2000
71162865 iica E Feb. 15, 2020, 2:53 p.m. OK D TESTS 94 1606 39731200 2000
71198708 LucasQi E Feb. 16, 2020, 5:40 a.m. OK GNU C++11 TESTS 94 93 6963200 2000
71256936 shuashuawan E Feb. 17, 2020, 5:08 a.m. OK GNU C++11 TESTS 94 93 7168000 2000
71206658 Frame233 E Feb. 16, 2020, 7:57 a.m. OK GNU C++11 TESTS 94 93 7168000 2000
71195532 YJJ_Konnyaku E Feb. 16, 2020, 4:28 a.m. OK GNU C++11 TESTS 94 93 7168000 2000
71147582 wangdyakioi E Feb. 15, 2020, 1:57 p.m. OK GNU C++11 TESTS 94 93 8294400 2000
71202483 wasa855 E Feb. 16, 2020, 6:48 a.m. OK GNU C++11 TESTS 94 93 8806400 2000
71225230 _Backl1ght E Feb. 16, 2020, 1:32 p.m. OK GNU C++11 TESTS 94 93 8908800 2000
71197411 froggyzhang E Feb. 16, 2020, 5:14 a.m. OK GNU C++11 TESTS 94 93 14438400 2000
71153804 Froggygua E Feb. 15, 2020, 2:19 p.m. OK GNU C++11 TESTS 94 93 14438400 2000
71223501 zhtjtcz E Feb. 16, 2020, 1:01 p.m. OK GNU C++11 TESTS 94 93 20377600 2000
71193359 _Andromeda E Feb. 16, 2020, 3:16 a.m. OK GNU C++14 TESTS 94 93 19456000 2000
71193214 _Andromeda E Feb. 16, 2020, 3:11 a.m. OK GNU C++14 TESTS 94 109 22835200 2000
71161500 pufanyi E Feb. 15, 2020, 2:48 p.m. OK GNU C++14 TESTS 94 124 11468800 2000
71148356 wleung_bvg E Feb. 15, 2020, 2 p.m. OK GNU C++14 TESTS 94 139 19865600 2000
71273128 jinhb5519 E Feb. 17, 2020, 11:09 a.m. OK GNU C++14 TESTS 94 187 15564800 2000
71273050 jinhb5519 E Feb. 17, 2020, 11:07 a.m. OK GNU C++14 TESTS 94 187 15564800 2000
71155565 whczr E Feb. 15, 2020, 2:25 p.m. OK GNU C++14 TESTS 94 202 7168000 2000
71153908 GOATWU E Feb. 15, 2020, 2:19 p.m. OK GNU C++14 TESTS 94 202 13619200 2000
71204755 jinhb5519 E Feb. 16, 2020, 7:25 a.m. OK GNU C++14 TESTS 94 202 15564800 2000
71340657 arktan763 E Feb. 17, 2020, 8:34 p.m. OK GNU C++14 TESTS 94 233 9011200 2000
71202653 wawcac E Feb. 16, 2020, 6:51 a.m. OK GNU C++17 TESTS 94 187 8806400 2000
71229735 John_Ran E Feb. 16, 2020, 2:49 p.m. OK GNU C++17 TESTS 94 187 9625600 2000
71267692 SelfStrong_SONG E Feb. 17, 2020, 9:14 a.m. OK GNU C++17 TESTS 94 187 33792000 2000
71162660 kqsCCA E Feb. 15, 2020, 2:52 p.m. OK GNU C++17 TESTS 94 202 7168000 2000
71200902 ftiasch E Feb. 16, 2020, 6:19 a.m. OK GNU C++17 TESTS 94 202 12185600 2000
71228604 Compiled E Feb. 16, 2020, 2:27 p.m. OK GNU C++17 TESTS 94 202 12390400 2000
71228354 Compiled E Feb. 16, 2020, 2:23 p.m. OK GNU C++17 TESTS 94 202 13209600 2000
71200391 Narut E Feb. 16, 2020, 6:10 a.m. OK GNU C++17 TESTS 94 202 13824000 2000
71194849 Narut E Feb. 16, 2020, 4:08 a.m. OK GNU C++17 TESTS 94 202 13824000 2000
71158733 Ethylene E Feb. 15, 2020, 2:37 p.m. OK GNU C++17 TESTS 94 202 20070400 2000
71238968 synapse E Feb. 16, 2020, 5:55 p.m. OK Go TESTS 94 234 49971200 2000
71238344 synapse E Feb. 16, 2020, 5:41 p.m. OK Go TESTS 94 514 51507200 2000
71238620 synapse E Feb. 16, 2020, 5:47 p.m. OK Go TESTS 94 545 51507200 2000
71256205 synapse E Feb. 17, 2020, 4:43 a.m. OK Go TESTS 94 639 18124800 2000
71255440 synapse E Feb. 17, 2020, 4:13 a.m. OK Go TESTS 94 670 18534400 2000
71255550 synapse E Feb. 17, 2020, 4:18 a.m. OK Go TESTS 94 685 29696000 2000
71255616 synapse E Feb. 17, 2020, 4:20 a.m. OK Go TESTS 94 702 29184000 2000
71174733 Jughead E Feb. 15, 2020, 5:39 p.m. OK Go TESTS 94 920 47923200 2000
71514688 ontake E Feb. 20, 2020, 7:32 p.m. OK Go TESTS 94 1575 23244800 2000
71388265 Anonymous E Feb. 18, 2020, 3:31 p.m. OK Java 11 TESTS 94 452 6553600 2000
71157405 ZeyadKhattab E Feb. 15, 2020, 2:32 p.m. OK Java 11 TESTS 94 966 111001600 2000
71169945 TheSawan E Feb. 15, 2020, 4:47 p.m. OK Java 11 TESTS 94 1029 46080000 2000
71141345 lightseba E Feb. 15, 2020, 1:40 p.m. OK Java 11 TESTS 94 1045 129945600 2000
71193477 bleh0.5 E Feb. 16, 2020, 3:19 a.m. OK Java 11 TESTS 94 1091 88780800 2000
71156803 aman28rwt E Feb. 15, 2020, 2:30 p.m. OK Java 8 TESTS 94 374 5427200 2000
71185418 mbfeci E Feb. 15, 2020, 9:20 p.m. OK Java 8 TESTS 94 405 24371200 2000
71191643 Sharon E Feb. 16, 2020, 2:10 a.m. OK Java 8 TESTS 94 483 17715200 2000
71176882 BaZ_ E Feb. 15, 2020, 6:15 p.m. OK Java 8 TESTS 94 498 27443200 2000
71634307 Ahmed_Diab E Feb. 22, 2020, 9:08 p.m. OK Java 8 TESTS 94 499 10752000 2000
71221218 sonusingh.nitaa E Feb. 16, 2020, 12:18 p.m. OK Java 8 TESTS 94 530 39731200 2000
71175871 gouh9qn E Feb. 15, 2020, 5:58 p.m. OK Java 8 TESTS 94 608 35328000 2000
71343336 kraken7 E Feb. 17, 2020, 9:57 p.m. OK Java 8 TESTS 94 623 32563200 2000
71343191 kraken7 E Feb. 17, 2020, 9:52 p.m. OK Java 8 TESTS 94 623 32563200 2000
71190038 ijxjdjd E Feb. 16, 2020, 12:55 a.m. OK Java 8 TESTS 94 638 46284800 2000
71156274 Spheniscine E Feb. 15, 2020, 2:28 p.m. OK Kotlin TESTS 94 358 29593600 2000
71246505 SlavaG E Feb. 16, 2020, 9:13 p.m. OK Kotlin TESTS 94 1622 54681600 2000
71173148 hibatibati E Feb. 15, 2020, 5:18 p.m. OK Mono C# TESTS 94 763 25190400 2000
71189289 tomomo2b2 E Feb. 16, 2020, 12:10 a.m. OK Mono C# TESTS 94 764 45568000 2000
71254274 nehan_der_thal E Feb. 17, 2020, 3:28 a.m. OK Mono C# TESTS 94 951 39936000 2000
71171096 Yupiteru E Feb. 15, 2020, 4:54 p.m. OK Mono C# TESTS 94 1060 173260800 2000
71215245 plasma-effect E Feb. 16, 2020, 10:21 a.m. OK Mono C# TESTS 94 1106 34099200 2000
71620197 sergmel E Feb. 22, 2020, 3:30 p.m. OK Mono C# TESTS 94 1294 25702400 2000
71220410 vjudge5 E Feb. 16, 2020, 12:01 p.m. OK MS C++ TESTS 94 436 17100800 2000
71220054 vjudge3 E Feb. 16, 2020, 11:54 a.m. OK MS C++ TESTS 94 483 13619200 2000
71157257 songhaoran E Feb. 15, 2020, 2:32 p.m. OK MS C++ TESTS 94 623 13619200 2000
71158556 oceanlin E Feb. 15, 2020, 2:37 p.m. OK MS C++ 2017 TESTS 94 233 15564800 2000
71165308 vitux E Feb. 15, 2020, 3:01 p.m. OK MS C++ 2017 TESTS 94 358 16076800 2000
71162722 BpeMeHHa91_TryDHocTb E Feb. 15, 2020, 2:52 p.m. OK MS C++ 2017 TESTS 94 374 10035200 2000
71175425 CrashMaster E Feb. 15, 2020, 5:51 p.m. OK MS C++ 2017 TESTS 94 468 15462400 2000
71170079 CrashMaster E Feb. 15, 2020, 4:48 p.m. OK MS C++ 2017 TESTS 94 483 15462400 2000
71156485 youx E Feb. 15, 2020, 2:29 p.m. OK MS C++ 2017 TESTS 94 561 14540800 2000
71225923 btwiusearch E Feb. 16, 2020, 1:44 p.m. OK MS C++ 2017 TESTS 94 577 13209600 2000
71441957 Conar E Feb. 19, 2020, 2:04 p.m. OK MS C++ 2017 TESTS 94 654 57753600 2000
71419604 Conar E Feb. 19, 2020, 7:01 a.m. OK MS C++ 2017 TESTS 94 670 10752000 2000
71336203 extremum E Feb. 17, 2020, 7:14 p.m. OK MS C++ 2017 TESTS 94 670 15257600 2000
71182917 pajenegod E Feb. 15, 2020, 8:14 p.m. OK PyPy 2 TESTS 94 608 48332800 2000
71182971 pajenegod E Feb. 15, 2020, 8:16 p.m. OK PyPy 2 TESTS 94 639 48332800 2000
71182735 pajenegod E Feb. 15, 2020, 8:10 p.m. OK PyPy 2 TESTS 94 639 50176000 2000
71162949 pajenegod E Feb. 15, 2020, 2:53 p.m. OK PyPy 2 TESTS 94 748 57446400 2000
71151046 cftt E Feb. 15, 2020, 2:09 p.m. OK PyPy 3 TESTS 94 1871 35430400 2000
71165071 old_boo E Feb. 15, 2020, 3 p.m. OK PyPy 3 TESTS 94 2292 95027200 2000
71160470 asvasil E Feb. 15, 2020, 2:44 p.m. OK PyPy 3 TESTS 94 2324 27443200 2000
71201818 nehan_der_thal E Feb. 16, 2020, 6:35 a.m. OK PyPy 3 TESTS 94 2558 67686400 2000
71251947 nehan_der_thal E Feb. 17, 2020, 1:45 a.m. OK PyPy 3 TESTS 94 2573 67481600 2000
71252046 nehan_der_thal E Feb. 17, 2020, 1:50 a.m. OK PyPy 3 TESTS 94 2589 67481600 2000
71277282 zqx1392 E Feb. 17, 2020, 12:35 p.m. OK PyPy 3 TESTS 94 2605 64614400 2000
71199940 nehan_der_thal E Feb. 16, 2020, 6:02 a.m. OK PyPy 3 TESTS 94 2667 66867200 2000
71201579 tamato E Feb. 16, 2020, 6:31 a.m. OK PyPy 3 TESTS 94 2776 75571200 2000
71196513 nehan_der_thal E Feb. 16, 2020, 4:53 a.m. OK PyPy 3 TESTS 94 2900 68403200 2000
71164737 throwawayatcoder E Feb. 15, 2020, 2:59 p.m. OK Python 3 TESTS 94 3150 50995200 2000
71383760 sansen E Feb. 18, 2020, 2:18 p.m. OK Rust TESTS 94 124 18022400 2000
71382609 sansen E Feb. 18, 2020, 2:01 p.m. OK Rust TESTS 94 124 18022400 2000
71196043 akiradeveloper E Feb. 16, 2020, 4:42 a.m. OK Rust TESTS 94 1200 19660800 2000
71547223 mversic101 E Feb. 21, 2020, 11:49 a.m. OK Rust TESTS 94 1341 15462400 2000
71201413 terraformer E Feb. 16, 2020, 6:28 a.m. OK Rust TESTS 94 1512 27340800 2000

remove filters

Back to search problems