Codeforces Round 783 (Div. 1)

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
1667 Codeforces Round 783 (Div. 1) FINISHED False 7200 81444299 April 19, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 671 ) D Edge Elimination PROGRAMMING constructive algorithms dfs and similar dp trees 2900

B'You are given a tree (connected, undirected, acyclic graph) with n vertices. Two edges are adjacent if they share exactly one endpoint. In one move you can remove an arbitrary edge, if that edge is adjacent to an even number of remaining edges. Remove all of the edges, or determine that it is impossible. If there are multiple solutions, print any. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^5 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of vertices in the tree. Then n-1 lines follow. The i -th of them contains two integers u_i , v_i ( 1 <= u_i,v_i <= n ) the endpoints of the i -th edge. It is guaranteed that the given graph is a tree. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case print "NO" if it is impossible to remove all the edges. Otherwise print "YES", and in the next n-1 lines print a possible order of the removed edges. For each edge, print its endpoints in any order. Test case 1 : it is possible to remove the edge, because it is not adjacent to any other edge. Test case 2 : both edges are adjacent to exactly one edge, so it is impossible to remove any of them. So the answer is "NO". Test case 3 : the edge 2-3 is adjacent to two other edges. So it is possible to remove it. After that removal it is possible to remove the remaining edges too. '...

Tutorials

Codeforces Round #783 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154141757 dean.menezes D April 19, 2022, 7:36 p.m. OK Clang++17 Diagnostics TESTS 100 1793 178483200 2900
154129287 hos.lyric D April 19, 2022, 4:34 p.m. OK D TESTS 100 608 58982400 2900
154378425 rainboy D April 21, 2022, 3:38 p.m. OK GNU C11 TESTS 100 1122 24780800 2900
154186270 bkifhr6 D April 20, 2022, 10:14 a.m. OK GNU C++14 TESTS 100 218 25190400 2900
154623129 XueYJ D April 23, 2022, 6:19 a.m. OK GNU C++14 TESTS 100 233 18944000 2900
154506019 Suiseiseki D April 22, 2022, 2:07 p.m. OK GNU C++14 TESTS 100 248 18227200 2900
154797752 bkifhr9 D April 24, 2022, 12:27 a.m. OK GNU C++14 TESTS 100 249 19763200 2900
154450189 1092515503 D April 22, 2022, 1:02 a.m. OK GNU C++14 TESTS 100 264 19148800 2900
154244941 LZDQ D April 21, 2022, 3:59 a.m. OK GNU C++14 TESTS 100 264 20070400 2900
154189975 CCCCOrz D April 20, 2022, 11:08 a.m. OK GNU C++14 TESTS 100 280 19148800 2900
154854258 Comto D April 24, 2022, 1:07 p.m. OK GNU C++14 TESTS 100 280 19968000 2900
154110050 djq_cpp D April 19, 2022, 3:40 p.m. OK GNU C++14 TESTS 100 295 20787200 2900
154214560 -skyline- D April 20, 2022, 4:17 p.m. OK GNU C++14 TESTS 100 295 21401600 2900
154268616 lddlinan D April 21, 2022, 10:56 a.m. OK GNU C++17 TESTS 100 187 19148800 2900
154258643 Not_Determinedd D April 21, 2022, 8:35 a.m. OK GNU C++17 TESTS 100 249 25497600 2900
154155881 Intercept D April 20, 2022, 1:35 a.m. OK GNU C++17 TESTS 100 265 29491200 2900
154123174 _FireBladeMaster_ D April 19, 2022, 4:16 p.m. OK GNU C++17 TESTS 100 280 25497600 2900
154120695 Luca D April 19, 2022, 4:09 p.m. OK GNU C++17 TESTS 100 280 28057600 2900
154489978 Karashi D April 22, 2022, 11:22 a.m. OK GNU C++17 TESTS 100 280 97792000 2900
154133694 ITO D April 19, 2022, 6 p.m. OK GNU C++17 TESTS 100 296 29696000 2900
154193580 MonkeyKing D April 20, 2022, 11:53 a.m. OK GNU C++17 TESTS 100 296 35430400 2900
154256118 Meredov D April 21, 2022, 7:53 a.m. OK GNU C++17 TESTS 100 311 18944000 2900
154231000 mohamedelsadek D April 20, 2022, 9:23 p.m. OK GNU C++17 TESTS 100 311 18944000 2900
154179577 CE_WA_TLE D April 20, 2022, 8:35 a.m. OK GNU C++17 (64) TESTS 100 124 66764800 2900
154188149 basic_string D April 20, 2022, 10:42 a.m. OK GNU C++17 (64) TESTS 100 187 59494400 2900
154379222 rainboy D April 21, 2022, 3:39 p.m. OK GNU C++17 (64) TESTS 100 264 36352000 2900
154126315 Xellos D April 19, 2022, 4:26 p.m. OK GNU C++17 (64) TESTS 100 264 48537600 2900
154193940 froggyzhang D April 20, 2022, 11:57 a.m. OK GNU C++17 (64) TESTS 100 265 45158400 2900
154241306 slenbol D April 21, 2022, 2:25 a.m. OK GNU C++17 (64) TESTS 100 280 27136000 2900
154210335 xyf007 D April 20, 2022, 3:18 p.m. OK GNU C++17 (64) TESTS 100 280 33587200 2900
154126853 Sana D April 19, 2022, 4:28 p.m. OK GNU C++17 (64) TESTS 100 295 32563200 2900
154132918 Froggygua D April 19, 2022, 5:56 p.m. OK GNU C++17 (64) TESTS 100 295 45158400 2900
154129038 potato167 D April 19, 2022, 4:34 p.m. OK GNU C++17 (64) TESTS 100 296 24883200 2900
154158063 Tyyyyyy D April 20, 2022, 2:34 a.m. OK GNU C++20 (64) TESTS 100 202 42496000 2900
154229646 czhang2718 D April 20, 2022, 8:51 p.m. OK GNU C++20 (64) TESTS 100 218 35942400 2900
154787109 emorgan5289 D April 23, 2022, 8:18 p.m. OK GNU C++20 (64) TESTS 100 218 41881600 2900
154173044 yzc2005 D April 20, 2022, 6:56 a.m. OK GNU C++20 (64) TESTS 100 218 42188800 2900
154204644 Sakuyalove D April 20, 2022, 2:03 p.m. OK GNU C++20 (64) TESTS 100 218 43622400 2900
154155472 syl123456 D April 20, 2022, 1:24 a.m. OK GNU C++20 (64) TESTS 100 234 53657600 2900
154242345 platelet D April 21, 2022, 2:54 a.m. OK GNU C++20 (64) TESTS 100 249 31334400 2900
154601301 Tiagodfs D April 22, 2022, 10:09 p.m. OK GNU C++20 (64) TESTS 100 249 36147200 2900
154172896 YxqK D April 20, 2022, 6:54 a.m. OK GNU C++20 (64) TESTS 100 249 38604800 2900
154267850 BlueDiamond D April 21, 2022, 10:44 a.m. OK GNU C++20 (64) TESTS 100 264 37990400 2900
154120720 iakovlev.zakhar D April 19, 2022, 4:09 p.m. OK Java 8 TESTS 100 764 124006400 2900
154126741 Sparky_Master_WCH1226 D April 19, 2022, 4:27 p.m. OK Kotlin 1.4 TESTS 100 1029 112640000 2900
154134471 Tlatoani D April 19, 2022, 6:05 p.m. OK Kotlin 1.4 TESTS 100 1855 227430400 2900

remove filters

Back to search problems