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 |
---|---|---|---|---|---|---|
1119 | Codeforces Global Round 2 | FINISHED | False | 7200 | 177272699 | April 6, 2019, 11:35 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 731 ) | F | Niyaz and Small Degrees | PROGRAMMING | data structures dp trees | 2900 |
B"Niyaz has a tree with n vertices numerated from 1 to n . A tree is a connected graph without cycles. Each edge in this tree has strictly positive integer weight. A degree of a vertex is the number of edges adjacent to this vertex. Niyaz does not like when vertices in the tree have too large degrees. For each x from 0 to (n-1) , he wants to find the smallest total weight of a set of edges to be deleted so that degrees of all vertices become at most x . The first line contains a single integer n ( 2 <= n <= 250 ,000 ) -- the number of vertices in Niyaz's tree. Each of the next (n - 1) lines contains three integers a , b , c ( 1 <= a, b <= n , 1 <= q c <= q 10^6 ) -- the indices of the vertices connected by this edge and its weight, respectively. It is guaranteed that the given edges form a tree. Print n integers: for each x = 0, 1, ldots, (n-1) print the smallest total weight of such a set of edges that after one deletes the edges from the set, the degrees of all vertices become less than or equal to x . In the first example, the vertex 1 is connected with all other vertices. So for each x you should delete the (4-x) lightest edges outgoing from vertex 1 , so the answers are 1+2+3+4 , 1+2+3 , 1+2 , 1 and 0 . In the second example, for x=0 you need to delete all the edges, for x=1 you can delete two edges with weights 1 and 5 , and for x geq 2 it is not necessary to delete edges, so the answers are 1+2+5+14 , 1+5 , 0 , 0 and 0 . "... |
Codeforces Global Round 2 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
57710796 | py_ultron | F | July 24, 2019, 11:37 p.m. | OK | GNU C++11 | TESTS | 55 | 296 | 42496000 | 2900 | |
52799383 | xgzepto | F | April 16, 2019, 1:20 a.m. | OK | GNU C++11 | TESTS | 55 | 296 | 42496000 | 2900 | |
57867018 | lopare | F | July 27, 2019, 9:51 p.m. | OK | GNU C++11 | TESTS | 55 | 311 | 42496000 | 2900 | |
64459733 | Rikuki | F | Nov. 7, 2019, 9:54 a.m. | OK | GNU C++11 | TESTS | 55 | 342 | 54579200 | 2900 | |
52929615 | CrazyDave | F | April 18, 2019, 12:09 a.m. | OK | GNU C++11 | TESTS | 55 | 343 | 50073600 | 2900 | |
52645188 | Stelutzu | F | April 12, 2019, 2:10 p.m. | OK | GNU C++11 | TESTS | 55 | 358 | 42496000 | 2900 | |
54902622 | M_sea | F | June 1, 2019, 7:25 a.m. | OK | GNU C++11 | TESTS | 55 | 373 | 47718400 | 2900 | |
53088949 | AutumnKite | F | April 21, 2019, 10:15 a.m. | OK | GNU C++11 | TESTS | 55 | 374 | 56115200 | 2900 | |
54802582 | Winniechen | F | May 29, 2019, 12:35 p.m. | OK | GNU C++11 | TESTS | 55 | 374 | 57344000 | 2900 | |
52766515 | SylvanasS | F | April 15, 2019, 4:22 a.m. | OK | GNU C++11 | TESTS | 55 | 405 | 73011200 | 2900 | |
52744635 | Weeeee | F | April 14, 2019, 10:58 a.m. | OK | GNU C++14 | TESTS | 55 | 404 | 43827200 | 2900 | |
55836484 | Toxel | F | June 20, 2019, 3:36 p.m. | OK | GNU C++14 | TESTS | 55 | 421 | 53452800 | 2900 | |
52490177 | apiadu | F | April 8, 2019, 11:17 a.m. | OK | GNU C++14 | TESTS | 55 | 467 | 51302400 | 2900 | |
53257201 | imaxblue | F | April 24, 2019, 5:33 p.m. | OK | GNU C++14 | TESTS | 55 | 467 | 54169600 | 2900 | |
52590474 | Rulenoonenevercomesecond | F | April 11, 2019, 5:11 a.m. | OK | GNU C++14 | TESTS | 55 | 468 | 51302400 | 2900 | |
52638989 | yzyyylx | F | April 12, 2019, 11:37 a.m. | OK | GNU C++14 | TESTS | 55 | 482 | 71680000 | 2900 | |
52555487 | bestFy | F | April 10, 2019, 7:32 a.m. | OK | GNU C++14 | TESTS | 55 | 483 | 66457600 | 2900 | |
52911178 | CrazyDave | F | April 17, 2019, 2:10 p.m. | OK | GNU C++14 | TESTS | 55 | 483 | 71680000 | 2900 | |
52681872 | dsl2002 | F | April 13, 2019, 12:51 p.m. | OK | GNU C++14 | TESTS | 55 | 498 | 64102400 | 2900 | |
52799446 | luogu_bot3 | F | April 16, 2019, 1:26 a.m. | OK | GNU C++14 | TESTS | 55 | 499 | 42700800 | 2900 | |
53275524 | SDNU_LuoXinC | F | April 25, 2019, 9:10 a.m. | OK | GNU C++17 | TESTS | 55 | 467 | 62464000 | 2900 | |
52639708 | _LeMur_ | F | April 12, 2019, 11:57 a.m. | OK | GNU C++17 | TESTS | 55 | 467 | 101273600 | 2900 | |
52527264 | sheaf | F | April 9, 2019, noon | OK | GNU C++17 | TESTS | 55 | 483 | 54579200 | 2900 | |
54652366 | zjsdut | F | May 26, 2019, 6:16 a.m. | OK | GNU C++17 | TESTS | 55 | 498 | 48947200 | 2900 | |
53225023 | SDNU_LuoXinC | F | April 24, 2019, 1:58 p.m. | OK | GNU C++17 | TESTS | 55 | 498 | 62464000 | 2900 | |
52515362 | Als123 | F | April 9, 2019, 4:50 a.m. | OK | GNU C++17 | TESTS | 55 | 514 | 70860800 | 2900 | |
52525723 | me_Rose_max_Always_AK | F | April 9, 2019, 11:22 a.m. | OK | GNU C++17 | TESTS | 55 | 530 | 56934400 | 2900 | |
52672442 | qiu1 | F | April 13, 2019, 8:07 a.m. | OK | GNU C++17 | TESTS | 55 | 530 | 65945600 | 2900 | |
52554577 | ainta | F | April 10, 2019, 6:55 a.m. | OK | GNU C++17 | TESTS | 55 | 545 | 58777600 | 2900 | |
66549030 | user202729_ | F | Dec. 9, 2019, 2:11 p.m. | OK | GNU C++17 | TESTS | 55 | 545 | 59187200 | 2900 | |
52407241 | Petr | F | April 6, 2019, 1:07 p.m. | OK | Java 8 | TESTS | 55 | 1762 | 144896000 | 2900 | |
52915919 | dalt | F | April 17, 2019, 3:50 p.m. | OK | Java 8 | TESTS | 55 | 2230 | 268390400 | 2900 | |
53487318 | lucasr | F | April 29, 2019, 5:29 a.m. | OK | Java 8 | TESTS | 55 | 2714 | 196915200 | 2900 | |
55093065 | S.K | F | June 4, 2019, 3:34 p.m. | OK | MS C++ | TESTS | 55 | 545 | 71782400 | 2900 | |
52447815 | Mr_Spade | F | April 7, 2019, 8:36 a.m. | OK | MS C++ 2017 | TESTS | 55 | 2761 | 173260800 | 2900 |
Back to search problems