Codeforces Global Round 24

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
1764 Codeforces Global Round 24 FINISHED False 9000 67708463 Nov. 26, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1046 ) F Doremy's Experimental Tree PROGRAMMING brute force constructive algorithms dfs and similar ds sortings trees

B'Doremy has an edge-weighted tree with n vertices whose weights are integers between 1 and 10^9 . She does frac{n(n+1)}{2} experiments on it. In each experiment, Doremy chooses vertices i and j such that j <= q i and connects them directly with an edge with weight 1 . Then, there is exactly one cycle (or self-loop when i=j ) in the graph. Doremy defines f(i,j) as the sum of lengths of shortest paths from every vertex to the cycle. Formally, let mathrm{dis}_{i,j}(x,y) be the length of the shortest path between vertex x and y when the edge (i,j) of weight 1 is added, and S_{i,j} be the set of vertices that are on the cycle when edge (i,j) is added. Then, f(i,j)= sum_{x=1}^{n} <= ft( min_{y in S_{i,j}} mathrm{dis}_{i,j}(x,y) right). Doremy writes down all values of f(i,j) such that 1 <= q j <= q i <= q n , then goes to sleep. However, after waking up, she finds that the tree has gone missing. Fortunately, the values of f(i,j) are still in her notebook, and she knows which i and j they belong to. Given the values of f(i,j) , can you help her restore the tree? It is guaranteed that at least one suitable tree exists. The first line of input contains a single integer n ( 2 <= n <= 2000 ) -- the number of vertices in the tree. The following n lines contain a lower-triangular matrix with i integers on the i -th line; the j -th integer on the i -th line is f(i,j) ( 0 <= f(i,j) <= 2 cdot 10^{15} ). It is guaranteed that there exists a tree whose weights are integers between 1 and 10^9 such that the values of f(i,j) of the tree match those given in the input. Print n-1 lines describing the tree. In the i -th line of the output, output three integers u_i , v_i , w_i ( 1 <= u_i,v_i <= n , 1 <= w_i <= 10^9 ), represen'...

Tutorials

Codeforces Global Round 24 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
182696366 KumaTachiRen F Nov. 26, 2022, 4:20 p.m. OK C# 8 TESTS 76 858 103526400
182688361 hos.lyric F Nov. 26, 2022, 3:42 p.m. OK D TESTS 76 935 54579200
182708348 rainboy F Nov. 26, 2022, 5:58 p.m. OK GNU C11 TESTS 76 592 32051200
182697294 yinianzhijian F Nov. 26, 2022, 4:25 p.m. OK GNU C++14 TESTS 76 389 150118400
182741180 m1979823301m F Nov. 27, 2022, 5:18 a.m. OK GNU C++14 TESTS 76 733 32051200
182741298 nick1004 F Nov. 27, 2022, 5:20 a.m. OK GNU C++14 TESTS 76 748 32051200
182684608 Sol1 F Nov. 26, 2022, 3:26 p.m. OK GNU C++14 TESTS 76 748 90624000
182691264 chuochuo F Nov. 26, 2022, 3:56 p.m. OK GNU C++14 TESTS 76 764 32665600
182692528 ABitstOCHASTIC F Nov. 26, 2022, 4:02 p.m. OK GNU C++14 TESTS 76 780 32460800
182703832 LianYouChang F Nov. 26, 2022, 5:15 p.m. OK GNU C++14 TESTS 76 795 32256000
182693988 wolf29 F Nov. 26, 2022, 4:09 p.m. OK GNU C++14 TESTS 76 795 50176000
182703118 Noam527 F Nov. 26, 2022, 5:09 p.m. OK GNU C++14 TESTS 76 826 32665600
182696202 awoo F Nov. 26, 2022, 4:20 p.m. OK GNU C++14 TESTS 76 842 32870400
182696137 gabrielwu F Nov. 26, 2022, 4:19 p.m. OK GNU C++17 TESTS 76 748 32358400
182685474 pashka F Nov. 26, 2022, 3:30 p.m. OK GNU C++17 TESTS 76 748 32563200
182707521 chemthan F Nov. 26, 2022, 5:49 p.m. OK GNU C++17 TESTS 76 748 32665600
182693093 Puranya_ F Nov. 26, 2022, 4:04 p.m. OK GNU C++17 TESTS 76 763 32665600
182690200 blackyuki F Nov. 26, 2022, 3:51 p.m. OK GNU C++17 TESTS 76 764 33075200
182696416 fanache99 F Nov. 26, 2022, 4:21 p.m. OK GNU C++17 TESTS 76 794 96665600
182698102 highboi F Nov. 26, 2022, 4:28 p.m. OK GNU C++17 TESTS 76 795 22220800
182702155 zhangguangxuan99 F Nov. 26, 2022, 5:03 p.m. OK GNU C++17 TESTS 76 826 32153600
182703153 ayingna F Nov. 26, 2022, 5:09 p.m. OK GNU C++17 TESTS 76 826 32256000
182734624 ngyupeng06 F Nov. 27, 2022, 2:39 a.m. OK GNU C++17 TESTS 76 826 32665600
182689049 QAQAutoMaton F Nov. 26, 2022, 3:46 p.m. OK GNU C++17 (64) TESTS 76 156 36454400
182710487 neal F Nov. 26, 2022, 6:16 p.m. OK GNU C++17 (64) TESTS 76 202 35328000
182697850 creep F Nov. 26, 2022, 4:27 p.m. OK GNU C++17 (64) TESTS 76 483 32153600
182686972 riano_ F Nov. 26, 2022, 3:36 p.m. OK GNU C++17 (64) TESTS 76 514 32358400
182692560 Nutella3000-7 F Nov. 26, 2022, 4:02 p.m. OK GNU C++17 (64) TESTS 76 514 35635200
182696411 TheScrasse F Nov. 26, 2022, 4:21 p.m. OK GNU C++17 (64) TESTS 76 529 35430400
182688253 blackbori F Nov. 26, 2022, 3:42 p.m. OK GNU C++17 (64) TESTS 76 529 55091200
182684379 potato167 F Nov. 26, 2022, 3:25 p.m. OK GNU C++17 (64) TESTS 76 530 35430400
182695998 Kazumin F Nov. 26, 2022, 4:18 p.m. OK GNU C++17 (64) TESTS 76 530 64614400
182692958 q-w-q-w-q F Nov. 26, 2022, 4:04 p.m. OK GNU C++17 (64) TESTS 76 546 52121600
182734907 Tutis F Nov. 27, 2022, 2:47 a.m. OK GNU C++20 (64) TESTS 76 109 65740800
182733660 Tutis F Nov. 27, 2022, 2:12 a.m. OK GNU C++20 (64) TESTS 76 109 65740800
182733592 Tutis F Nov. 27, 2022, 2:10 a.m. OK GNU C++20 (64) TESTS 76 109 65740800
182680429 Vercingetorix F Nov. 26, 2022, 3:10 p.m. OK GNU C++20 (64) TESTS 76 140 35840000
182694194 sleep__ F Nov. 26, 2022, 4:10 p.m. OK GNU C++20 (64) TESTS 76 170 128921600
182702022 SSerxhs F Nov. 26, 2022, 5:02 p.m. OK GNU C++20 (64) TESTS 76 202 34201600
182732940 Tutis F Nov. 27, 2022, 1:49 a.m. OK GNU C++20 (64) TESTS 76 327 32051200
182699449 OotoriEmu F Nov. 26, 2022, 4:33 p.m. OK GNU C++20 (64) TESTS 76 327 110387200
182733029 Tutis F Nov. 27, 2022, 1:52 a.m. OK GNU C++20 (64) TESTS 76 343 16076800
182732842 Tutis F Nov. 27, 2022, 1:45 a.m. OK GNU C++20 (64) TESTS 76 373 32051200
182697103 SecondThread F Nov. 26, 2022, 4:24 p.m. OK Java 8 TESTS 76 2074 143974400
182686773 arvindf232 F Nov. 26, 2022, 3:35 p.m. OK Kotlin 1.6 TESTS 76 764 79257600
182708573 amethyst0 F Nov. 26, 2022, 6 p.m. OK MS C++ 2017 TESTS 76 763 32460800
182687290 gnomina007 F Nov. 26, 2022, 3:38 p.m. OK MS C++ 2017 TESTS 76 2433 72806400
182683638 asdsasd F Nov. 26, 2022, 3:22 p.m. OK PyPy 3-64 TESTS 76 1123 136499200
182693675 sansen F Nov. 26, 2022, 4:07 p.m. OK Rust 2021 TESTS 76 733 85299200

remove filters

Back to search problems