Codeforces Round 866 (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
1819 Codeforces Round 866 (Div. 1) FINISHED False 7200 50273699 April 15, 2023, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1493 ) C The Fox and the Complete Tree Traversal PROGRAMMING constructive algorithms dp games implementation math trees

B'The fox Yae climbed the tree of the Sacred Sakura. A tree is a connected undirected graph that does not contain cycles. The fox uses her magical powers to move around the tree. Yae can jump from vertex v to another vertex u if and only if the distance between these vertices does not exceed 2 . In other words, in one jump Yae can jump from vertex v to vertex u if vertices v and u are connected by an edge, or if there exists such vertex w that vertices v and w are connected by an edge, and also vertices u and w are connected by an edge. After Yae was able to get the sakura petal, she wondered if there was a cyclic route in the tree v_1, v_2, ldots, v_n such that: Help the fox determine if the required traversal exists. The first line contains one integer n ( 2 <= n <= 2 cdot 10^5 ) --the number of vertices of the tree. Each of the following n - 1 lines contains two integers u and v ( 1 <= u, v <= n , u ne v ) -- vertices connected by an edge. It is guaranteed that these edges form a tree. On the first line, print "Yes" (without quotes) if the required route of the tree exists, or "No" (without quotes) otherwise. If the required tree traversal exists, on the second line print n integers of different integers v_1, v_2, ldots, v_n ( 1 <= v_i <= n ) -- the vertices of the tree in traversal order. If there are several correct traversals, output any of them. The tree from the first example is shown below. The bold arrows indicate the fox 's route. In the second example, any sequence of three different vertices is a correct route, because the fox can jump from any vertex to any vertex. The tree from the third example is shown below. It can be shown that there is no required route for it. '...

Tutorials

Codeforces Round #866 (Div.1, Div.2, based on Lipetsk Team Olympiad) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
202224204 Gassa C April 15, 2023, 10:51 a.m. OK D TESTS 77 358 27443200
202201073 hos.lyric C April 15, 2023, 9:52 a.m. OK D TESTS 77 483 30822400
202234327 chro4896 C April 15, 2023, 11:54 a.m. OK GNU C11 TESTS 77 982 23244800
202223200 Pompeii C April 15, 2023, 10:48 a.m. OK GNU C++14 TESTS 77 187 14848000
202207660 XZC__Bobby C April 15, 2023, 10:06 a.m. OK GNU C++14 TESTS 77 202 16998400
202228611 ghj1222 C April 15, 2023, 11:02 a.m. OK GNU C++14 TESTS 77 202 23449600
202223779 ACOIer C April 15, 2023, 10:50 a.m. OK GNU C++14 TESTS 77 218 13619200
202237638 awoo C April 15, 2023, 12:13 p.m. OK GNU C++14 TESTS 77 234 14540800
202215142 Noam527 C April 15, 2023, 10:26 a.m. OK GNU C++14 TESTS 77 234 23244800
202214176 _Guoyh_ C April 15, 2023, 10:23 a.m. OK GNU C++14 TESTS 77 264 14848000
202316052 zltzlt C April 16, 2023, 2:26 a.m. OK GNU C++14 TESTS 78 264 21811200
202219087 hxhhxh C April 15, 2023, 10:36 a.m. OK GNU C++14 TESTS 77 265 16076800
202200745 huzhaoyang C April 15, 2023, 9:51 a.m. OK GNU C++14 TESTS 77 265 20070400
202322561 MarbIue C April 16, 2023, 4:23 a.m. OK GNU C++17 TESTS 78 217 33587200
202221179 newbiegcz C April 15, 2023, 10:42 a.m. OK GNU C++17 TESTS 77 218 18636800
202254886 Tiagodfs C April 15, 2023, 2:28 p.m. OK GNU C++17 TESTS 78 233 18944000
202237590 Cain C April 15, 2023, 12:12 p.m. OK GNU C++17 TESTS 77 233 31744000
202211810 peltorator C April 15, 2023, 10:17 a.m. OK GNU C++17 TESTS 77 249 8601600
202216427 Ant_Man C April 15, 2023, 10:29 a.m. OK GNU C++17 TESTS 77 249 12800000
202223736 chenxiaoyan C April 15, 2023, 10:50 a.m. OK GNU C++17 TESTS 77 249 21811200
202251458 Ilya_MSU C April 15, 2023, 2:01 p.m. OK GNU C++17 TESTS 78 249 25702400
202221225 al3xstr33t C April 15, 2023, 10:42 a.m. OK GNU C++17 TESTS 77 249 30720000
202253875 MarbIue C April 15, 2023, 2:20 p.m. OK GNU C++17 TESTS 78 249 33587200
202219542 math957963 C April 15, 2023, 10:38 a.m. OK GNU C++17 (64) TESTS 77 218 34406400
202322538 YYDingZheng C April 16, 2023, 4:23 a.m. OK GNU C++17 (64) TESTS 78 218 50892800
202202285 stevenkplus C April 15, 2023, 9:54 a.m. OK GNU C++17 (64) TESTS 77 218 57651200
202193878 MAOooOAM C April 15, 2023, 9:37 a.m. OK GNU C++17 (64) TESTS 77 233 13721600
202243162 MarcosK C April 15, 2023, 12:56 p.m. OK GNU C++17 (64) TESTS 78 233 17920000
202253915 kiivi C April 15, 2023, 2:20 p.m. OK GNU C++17 (64) TESTS 78 233 25497600
202220501 maomao90 C April 15, 2023, 10:40 a.m. OK GNU C++17 (64) TESTS 77 233 34611200
202234224 Amigomust C April 15, 2023, 11:53 a.m. OK GNU C++17 (64) TESTS 77 234 19046400
202201056 Rubikun C April 15, 2023, 9:52 a.m. OK GNU C++17 (64) TESTS 77 248 27545600
202210487 eriksuenderhauf C April 15, 2023, 10:14 a.m. OK GNU C++17 (64) TESTS 77 248 54681600
202220538 TJ_Andeviking C April 15, 2023, 10:40 a.m. OK GNU C++20 (64) TESTS 77 140 36556800
202247798 maxplus C April 15, 2023, 1:32 p.m. OK GNU C++20 (64) TESTS 78 155 12902400
202222172 magnus.hegdahl C April 15, 2023, 10:46 a.m. OK GNU C++20 (64) TESTS 77 156 40652800
202281262 MrNachoX C April 15, 2023, 6:48 p.m. OK GNU C++20 (64) TESTS 78 171 11366400
202219198 xukai C April 15, 2023, 10:37 a.m. OK GNU C++20 (64) TESTS 77 171 29798400
202248518 watashikininarimasu C April 15, 2023, 1:38 p.m. OK GNU C++20 (64) TESTS 78 186 22220800
202196625 Golovanov399 C April 15, 2023, 9:43 a.m. OK GNU C++20 (64) TESTS 77 187 14131200
202225161 LuCpp C April 15, 2023, 10:54 a.m. OK GNU C++20 (64) TESTS 77 187 24064000
202219400 atodo C April 15, 2023, 10:37 a.m. OK GNU C++20 (64) TESTS 77 187 24166400
202263219 flash0402 C April 15, 2023, 3:44 p.m. OK GNU C++20 (64) TESTS 78 187 29286400
202257174 elizarov C April 15, 2023, 2:49 p.m. OK Kotlin 1.7 TESTS 78 982 144486400
202314475 secondhalf C April 16, 2023, 1:53 a.m. OK PyPy 3-64 TESTS 78 841 58265600
202216479 toam C April 15, 2023, 10:29 a.m. OK PyPy 3-64 TESTS 77 967 74137600
202228571 WaterColor2037 C April 15, 2023, 11:02 a.m. OK Rust 2021 TESTS 77 186 22835200
202207850 Egor C April 15, 2023, 10:07 a.m. OK Rust 2021 TESTS 77 187 30515200
202206224 sansen C April 15, 2023, 10:03 a.m. OK Rust 2021 TESTS 77 202 36659200
202214004 hiratai C April 15, 2023, 10:23 a.m. OK Rust 2021 TESTS 77 264 73420800

remove filters

Back to search problems