Codeforces Global Round 9

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
1375 Codeforces Global Round 9 FINISHED False 9000 143306063 July 4, 2020, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1995 ) G Tree Modification PROGRAMMING dfs and similar greedy trees

B'You are given a tree with n vertices. You are allowed to modify the structure of the tree through the following multi-step operation: As an example, consider the following tree: The following diagram illustrates the sequence of steps that happen when we apply an operation to vertices 2 , 4 , and 5 : It can be proven that after each operation, the resulting graph is still a tree. Find the minimum number of operations that must be performed to transform the tree into a star. A star is a tree with one vertex of degree n - 1 , called its center, and n - 1 vertices of degree 1 . The first line contains an integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of vertices in the tree. The i -th of the following n - 1 lines contains two integers u_i and v_i ( 1 <= u_i, v_i <= n , u_i neq v_i ) denoting that there exists an edge connecting vertices u_i and v_i . It is guaranteed that the given edges form a tree. Print a single integer -- the minimum number of operations needed to transform the tree into a star. It can be proven that under the given constraints, it is always possible to transform the tree into a star using at most 10^{18} operations. The first test case corresponds to the tree shown in the statement. As we have seen before, we can transform the tree into a star with center at vertex 5 by applying a single operation to vertices 2 , 4 , and 5 . In the second test case, the given tree is already a star with the center at vertex 4 , so no operations have to be performed. '...

Tutorials

79731

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
85989345 hos.lyric G July 4, 2020, 4:55 p.m. OK D TESTS 91 249 28979200
86023423 BFLSTiger G July 5, 2020, 4:42 a.m. OK GNU C++11 TESTS 91 62 13312000
85997060 zjczzzjczjczzzjc G July 4, 2020, 5:14 p.m. OK GNU C++11 TESTS 91 93 9830400
85991090 Nazrin G July 4, 2020, 5 p.m. OK GNU C++11 TESTS 91 93 10956800
85992060 Isonan G July 4, 2020, 5:03 p.m. OK GNU C++11 TESTS 91 108 12800000
86019194 DWAE86 G July 5, 2020, 2:48 a.m. OK GNU C++11 TESTS 91 108 16486400
85992119 Fuyuki G July 4, 2020, 5:03 p.m. OK GNU C++11 TESTS 91 109 11161600
85977711 ohweonfire G July 4, 2020, 4:20 p.m. OK GNU C++11 TESTS 91 109 14950400
86021620 Big_black_jujube G July 5, 2020, 3:55 a.m. OK GNU C++11 TESTS 91 109 17305600
86020860 Frame233 G July 5, 2020, 3:33 a.m. OK GNU C++11 TESTS 91 109 17305600
85990360 laugher G July 4, 2020, 4:58 p.m. OK GNU C++11 TESTS 91 124 15052800
86003670 jk89 G July 4, 2020, 6:39 p.m. OK GNU C++14 TESTS 91 156 16486400
85977255 Nachia G July 4, 2020, 4:18 p.m. OK GNU C++14 TESTS 91 171 12288000
86013173 Nis1872 G July 4, 2020, 10:20 p.m. OK GNU C++14 TESTS 91 171 13516800
86002154 retawB G July 4, 2020, 6:18 p.m. OK GNU C++14 TESTS 91 171 13516800
85976660 Motarack G July 4, 2020, 4:17 p.m. OK GNU C++14 TESTS 91 171 13516800
86019288 zhou2003 G July 5, 2020, 2:51 a.m. OK GNU C++14 TESTS 91 171 14745600
86014774 WhaleVomit G July 4, 2020, 11:31 p.m. OK GNU C++14 TESTS 91 171 14950400
86007129 yk_ax G July 4, 2020, 7:37 p.m. OK GNU C++14 TESTS 91 171 15564800
86003951 Jael G July 4, 2020, 6:43 p.m. OK GNU C++14 TESTS 91 171 16486400
85973462 tmwilliamlin168 G July 4, 2020, 4:07 p.m. OK GNU C++14 TESTS 91 171 16486400
85983016 whzzt G July 4, 2020, 4:36 p.m. OK GNU C++17 TESTS 91 140 28979200
86009423 invictus_123 G July 4, 2020, 8:25 p.m. OK GNU C++17 TESTS 91 155 16486400
86016740 Tiagodfs G July 5, 2020, 1:11 a.m. OK GNU C++17 TESTS 91 155 18841600
86000172 Bench0310 G July 4, 2020, 5:57 p.m. OK GNU C++17 TESTS 91 170 12288000
86020583 qfhy G July 5, 2020, 3:25 a.m. OK GNU C++17 TESTS 91 170 16486400
86000771 vok8 G July 4, 2020, 6:03 p.m. OK GNU C++17 TESTS 91 170 17305600
86007044 LazyMist G July 4, 2020, 7:36 p.m. OK GNU C++17 TESTS 91 171 12185600
86022830 whd G July 5, 2020, 4:28 a.m. OK GNU C++17 TESTS 91 171 12288000
86013940 igoroogle G July 4, 2020, 10:53 p.m. OK GNU C++17 TESTS 91 171 12800000
86011138 ezdp G July 4, 2020, 9:12 p.m. OK GNU C++17 TESTS 91 171 12800000
85989978 yosupo G July 4, 2020, 4:57 p.m. OK GNU C++17 (64) TESTS 91 109 36454400
85989194 RNS_KSB G July 4, 2020, 4:54 p.m. OK GNU C++17 (64) TESTS 91 124 19763200
85978530 Egor G July 4, 2020, 4:22 p.m. OK GNU C++17 (64) TESTS 91 124 29184000
86010583 conquizztador G July 4, 2020, 8:54 p.m. OK GNU C++17 (64) TESTS 91 155 19660800
86008474 saeed_odak G July 4, 2020, 8:05 p.m. OK GNU C++17 (64) TESTS 91 155 20480000
86008640 Marckess G July 4, 2020, 8:08 p.m. OK GNU C++17 (64) TESTS 91 155 24371200
86013033 wwdd G July 4, 2020, 10:15 p.m. OK GNU C++17 (64) TESTS 91 156 22016000
86007608 timf1089 G July 4, 2020, 7:47 p.m. OK GNU C++17 (64) TESTS 91 156 22220800
85971097 teapotd G July 4, 2020, 4:01 p.m. OK GNU C++17 (64) TESTS 91 156 23961600
86010796 tugsuu G July 4, 2020, 9:01 p.m. OK GNU C++17 (64) TESTS 91 171 18841600
86017287 Xylenox G July 5, 2020, 1:38 a.m. OK Go TESTS 91 468 26009600
85988324 uwi G July 4, 2020, 4:52 p.m. OK Java 11 TESTS 91 280 31539200
86018138 PizzaLovers007 G July 5, 2020, 2:12 a.m. OK Java 11 TESTS 91 514 62771200
86008280 lucasr G July 4, 2020, 8 p.m. OK Java 8 TESTS 91 514 62361600
86004553 qlf9 G July 4, 2020, 6:52 p.m. OK Java 8 TESTS 91 592 57036800
86019684 pajenegod G July 5, 2020, 3:03 a.m. OK PyPy 2 TESTS 91 405 52121600
86011317 realnimish G July 4, 2020, 9:17 p.m. OK PyPy 2 TESTS 91 405 58675200
85984694 kclee2172 G July 4, 2020, 4:41 p.m. OK PyPy 3 TESTS 91 467 49356800
86002993 titia G July 4, 2020, 6:30 p.m. OK PyPy 3 TESTS 91 623 44339200
85973913 conqueror_of_tourist G July 4, 2020, 4:09 p.m. OK PyPy 3 TESTS 91 639 40243200
86017726 kcdchopin G July 5, 2020, 1:56 a.m. OK PyPy 3 TESTS 91 764 78540800
86023607 pedastrian57 G July 5, 2020, 4:47 a.m. OK PyPy 3 TESTS 91 842 55193600
86000946 sh1194 G July 4, 2020, 6:05 p.m. OK Python 3 TESTS 91 826 29081600
86001219 sh1194 G July 4, 2020, 6:08 p.m. OK Python 3 TESTS 91 982 29081600
86001010 sh1194 G July 4, 2020, 6:06 p.m. OK Python 3 TESTS 91 982 29081600
86001158 sh1194 G July 4, 2020, 6:07 p.m. OK Python 3 TESTS 91 998 29593600
86013072 zapdospops G July 4, 2020, 10:17 p.m. OK Python 3 TESTS 91 998 32153600
86015295 sansen G July 5, 2020, midnight OK Rust TESTS 91 124 19148800

remove filters

Back to search problems