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 |
---|---|---|---|---|---|---|
1714 | Codeforces Round 811 (Div. 3) | FINISHED | False | 8100 | 77815463 | Aug. 1, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 7886 ) | G | Path Prefixes | PROGRAMMING | binary search data structures dfs and similar implementation trees |
B'You are given a rooted tree. It contains n vertices, which are numbered from 1 to n . The root is the vertex 1 . Each edge has two positive integer values. Thus, two positive integers a_j and b_j are given for each edge. Output n-1 numbers r_2, r_3, ... , r_n , where r_i is defined as follows. Consider the path from the root (vertex 1 ) to i ( 2 <= i <= n ). Let the sum of the costs of a_j along this path be A_i . Then r_i is equal to the length of the maximum prefix of this path such that the sum of b_j along this prefix does not exceed A_i . Consider an example. In this case: The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases in the test. The descriptions of test cases follow. Each description begins with a line that contains an integer n ( 2 <= n <= 2 cdot10^5 ) -- the number of vertices in the tree. This is followed by n-1 string, each of which contains three numbers p_j, a_j, b_j ( 1 <= p_j <= n ; 1 <= a_j,b_j <= 10^9 ) -- the ancestor of the vertex j , the first and second values an edge that leads from p_j to j . The value of j runs through all values from 2 to n inclusive. It is guaranteed that each set of input data has a correct hanged tree with a root at the vertex 1 . It is guaranteed that the sum of n over all input test cases does not exceed 2 cdot10^5 . For each test case, output n-1 integer in one line: r_2, r_3, ... , r_n . The first example is clarified in the statement. In the second example: '... |
Codeforces Round #811 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
166603870 | orloffm | G | Aug. 1, 2022, 5:10 p.m. | OK | C# 10 | TESTS | 20 | 530 | 85708800 | ||
166608767 | LostTemple | G | Aug. 1, 2022, 5:45 p.m. | OK | C# 10 | TESTS | 20 | 560 | 100454400 | ||
166609028 | LostTemple | G | Aug. 1, 2022, 5:47 p.m. | OK | C# 10 | TESTS | 20 | 841 | 110899200 | ||
166652642 | vector114514 | G | Aug. 2, 2022, 5:33 a.m. | OK | GNU C++14 | TESTS | 20 | 156 | 24064000 | ||
166642439 | ERUIHNIYHBKBNF | G | Aug. 2, 2022, 2:54 a.m. | OK | GNU C++14 | TESTS | 20 | 171 | 26828800 | ||
166631978 | Tahsin13 | G | Aug. 1, 2022, 11:31 p.m. | OK | GNU C++14 | TESTS | 20 | 171 | 27648000 | ||
166651748 | luciannguyen07 | G | Aug. 2, 2022, 5:20 a.m. | OK | GNU C++14 | TESTS | 20 | 187 | 28672000 | ||
166639137 | Hytidel | G | Aug. 2, 2022, 2:03 a.m. | OK | GNU C++14 | TESTS | 20 | 187 | 33280000 | ||
166638690 | Hytidel | G | Aug. 2, 2022, 1:56 a.m. | OK | GNU C++14 | TESTS | 20 | 187 | 33280000 | ||
166634229 | zltzlt | G | Aug. 2, 2022, 12:34 a.m. | OK | GNU C++14 | TESTS | 20 | 202 | 24064000 | ||
166643262 | TeFuir123455 | G | Aug. 2, 2022, 3:07 a.m. | OK | GNU C++14 | TESTS | 20 | 202 | 24985600 | ||
166604710 | pinog | G | Aug. 1, 2022, 5:15 p.m. | OK | GNU C++14 | TESTS | 20 | 202 | 29286400 | ||
166602474 | Bedo_Sayed | G | Aug. 1, 2022, 5:03 p.m. | OK | GNU C++14 | TESTS | 20 | 202 | 29388800 | ||
166615915 | WWW.H | G | Aug. 1, 2022, 6:51 p.m. | OK | GNU C++17 | TESTS | 20 | 156 | 22425600 | ||
166644823 | zhenfisher | G | Aug. 2, 2022, 3:31 a.m. | OK | GNU C++17 | TESTS | 20 | 171 | 30003200 | ||
166608495 | dryeab | G | Aug. 1, 2022, 5:43 p.m. | OK | GNU C++17 | TESTS | 20 | 171 | 30003200 | ||
166613007 | razibul15-11649 | G | Aug. 1, 2022, 6:22 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 23449600 | ||
166648268 | kodewala | G | Aug. 2, 2022, 4:28 a.m. | OK | GNU C++17 | TESTS | 20 | 186 | 26828800 | ||
166612135 | mehrzad_minaei | G | Aug. 1, 2022, 6:14 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 27648000 | ||
166599848 | opoopop | G | Aug. 1, 2022, 4:51 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 27750400 | ||
166637610 | Ufowoqqqo | G | Aug. 2, 2022, 1:40 a.m. | OK | GNU C++17 | TESTS | 20 | 186 | 28262400 | ||
166632054 | SAFWAN.K | G | Aug. 1, 2022, 11:33 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 28979200 | ||
166606080 | UmMainAkali | G | Aug. 1, 2022, 5:24 p.m. | OK | GNU C++17 | TESTS | 20 | 186 | 30822400 | ||
166602419 | XHYU61 | G | Aug. 1, 2022, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 155 | 36864000 | ||
166645302 | Colala | G | Aug. 2, 2022, 3:38 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 155 | 43827200 | ||
166610885 | xju_lyc | G | Aug. 1, 2022, 6:03 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 155 | 44851200 | ||
166608798 | prakash_satya | G | Aug. 1, 2022, 5:45 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 156 | 45465600 | ||
166651537 | yaoveil | G | Aug. 2, 2022, 5:17 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 156 | 47206400 | ||
166621338 | Baaaraa | G | Aug. 1, 2022, 7:55 p.m. | OK | GNU C++17 (64) | TESTS | 20 | 170 | 36864000 | ||
166644646 | Haven_ | G | Aug. 2, 2022, 3:28 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 170 | 37478400 | ||
166654445 | Adarshgaur | G | Aug. 2, 2022, 5:57 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 170 | 50176000 | ||
166633511 | hellojim | G | Aug. 2, 2022, 12:17 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 171 | 30515200 | ||
166642751 | SanweiTreap | G | Aug. 2, 2022, 2:59 a.m. | OK | GNU C++17 (64) | TESTS | 20 | 171 | 31846400 | ||
166611404 | HaiyiWu | G | Aug. 1, 2022, 6:07 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 109 | 32051200 | ||
166611308 | HaiyiWu | G | Aug. 1, 2022, 6:06 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 32051200 | ||
166648798 | clumsy_ | G | Aug. 2, 2022, 4:37 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 33587200 | ||
166648681 | clumsy_ | G | Aug. 2, 2022, 4:35 a.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 33587200 | ||
166599814 | Swirl | G | Aug. 1, 2022, 4:51 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 36659200 | ||
166630414 | NO__OB | G | Aug. 1, 2022, 10:47 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 40652800 | ||
166626344 | bonopo | G | Aug. 1, 2022, 9:13 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 40652800 | ||
166620949 | dhru008 | G | Aug. 1, 2022, 7:50 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 41676800 | ||
166610867 | lite_27 | G | Aug. 1, 2022, 6:02 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 43008000 | ||
166609007 | new_li | G | Aug. 1, 2022, 5:47 p.m. | OK | GNU C++20 (64) | TESTS | 20 | 124 | 90931200 | ||
166640392 | profchi | G | Aug. 2, 2022, 2:23 a.m. | OK | Java 11 | TESTS | 20 | 483 | 52531200 | ||
166613504 | 110101011 | G | Aug. 1, 2022, 6:27 p.m. | OK | Java 11 | TESTS | 20 | 545 | 67584000 | ||
166606267 | syedmizbah | G | Aug. 1, 2022, 5:25 p.m. | OK | Java 11 | TESTS | 20 | 639 | 123904000 | ||
166605952 | gawsfbet | G | Aug. 1, 2022, 5:23 p.m. | OK | Java 11 | TESTS | 20 | 670 | 64000000 | ||
166601154 | csullivan203 | G | Aug. 1, 2022, 4:56 p.m. | OK | Java 11 | TESTS | 20 | 717 | 127283200 | ||
166615628 | BucketOfNubbins | G | Aug. 1, 2022, 6:48 p.m. | OK | Java 11 | TESTS | 20 | 748 | 96051200 | ||
166631946 | newguy1 | G | Aug. 1, 2022, 11:30 p.m. | OK | Java 11 | TESTS | 20 | 826 | 111308800 | ||
166599948 | MrOtter | G | Aug. 1, 2022, 4:52 p.m. | OK | Java 11 | TESTS | 20 | 872 | 143360000 | ||
166601257 | __Serendipity | G | Aug. 1, 2022, 4:57 p.m. | OK | Java 11 | TESTS | 20 | 888 | 244633600 | ||
166629337 | dzhi | G | Aug. 1, 2022, 10:19 p.m. | OK | Java 11 | TESTS | 20 | 1014 | 213504000 | ||
166607636 | soumit915 | G | Aug. 1, 2022, 5:35 p.m. | OK | Java 17 | TESTS | 20 | 436 | 77926400 | ||
166609562 | Mamimi | G | Aug. 1, 2022, 5:51 p.m. | OK | Java 17 | TESTS | 20 | 639 | 53964800 | ||
166617249 | leonlian | G | Aug. 1, 2022, 7:06 p.m. | OK | Java 8 | TESTS | 20 | 468 | 80896000 | ||
166610709 | ggghg | G | Aug. 1, 2022, 6:01 p.m. | OK | Java 8 | TESTS | 20 | 483 | 69427200 | ||
166599696 | SOME_ONEE | G | Aug. 1, 2022, 4:51 p.m. | OK | Java 8 | TESTS | 20 | 686 | 86220800 | ||
166638905 | cftauros | G | Aug. 2, 2022, 2 a.m. | OK | Java 8 | TESTS | 20 | 748 | 72704000 | ||
166639392 | cftauros | G | Aug. 2, 2022, 2:07 a.m. | OK | Java 8 | TESTS | 20 | 779 | 75161600 | ||
166639347 | cftauros | G | Aug. 2, 2022, 2:06 a.m. | OK | Java 8 | TESTS | 20 | 795 | 75980800 | ||
166639082 | cftauros | G | Aug. 2, 2022, 2:02 a.m. | OK | Java 8 | TESTS | 20 | 888 | 54988800 | ||
166639254 | cftauros | G | Aug. 2, 2022, 2:05 a.m. | OK | Java 8 | TESTS | 20 | 982 | 49356800 | ||
166639497 | cftauros | G | Aug. 2, 2022, 2:09 a.m. | OK | Java 8 | TESTS | 20 | 1247 | 40345600 | ||
166639687 | cftauros | G | Aug. 2, 2022, 2:12 a.m. | OK | Java 8 | TESTS | 20 | 1340 | 40345600 | ||
166600499 | drownedsun | G | Aug. 1, 2022, 4:54 p.m. | OK | Kotlin 1.6 | TESTS | 20 | 2058 | 100454400 | ||
166622674 | KKastaneda | G | Aug. 1, 2022, 8:14 p.m. | OK | MS C++ 2017 | TESTS | 20 | 685 | 21811200 | ||
166599673 | ANDREYkao__ | G | Aug. 1, 2022, 4:51 p.m. | OK | MS C++ 2017 | TESTS | 20 | 780 | 18944000 | ||
166652941 | kwin | G | Aug. 2, 2022, 5:38 a.m. | OK | PyPy 3-64 | TESTS | 20 | 654 | 72089600 | ||
166642561 | beethoven97 | G | Aug. 2, 2022, 2:55 a.m. | OK | PyPy 3-64 | TESTS | 20 | 701 | 91340800 | ||
166608550 | aayush_chhabra | G | Aug. 1, 2022, 5:43 p.m. | OK | PyPy 3-64 | TESTS | 20 | 701 | 100966400 | ||
166613452 | SoleProprietor | G | Aug. 1, 2022, 6:26 p.m. | OK | PyPy 3-64 | TESTS | 20 | 701 | 143360000 | ||
166602120 | Aksnov | G | Aug. 1, 2022, 5:01 p.m. | OK | PyPy 3-64 | TESTS | 20 | 717 | 92979200 | ||
166638202 | wwwwzhh | G | Aug. 2, 2022, 1:49 a.m. | OK | PyPy 3-64 | TESTS | 20 | 717 | 148684800 | ||
166619523 | Leocosmos | G | Aug. 1, 2022, 7:33 p.m. | OK | PyPy 3-64 | TESTS | 20 | 717 | 157388800 | ||
166617734 | HETRAKESHFADIA | G | Aug. 1, 2022, 7:12 p.m. | OK | PyPy 3-64 | TESTS | 20 | 733 | 157593600 | ||
166653242 | funywoohoo | G | Aug. 2, 2022, 5:42 a.m. | OK | PyPy 3-64 | TESTS | 20 | 764 | 128409600 | ||
166619586 | samchen123 | G | Aug. 1, 2022, 7:34 p.m. | OK | PyPy 3-64 | TESTS | 20 | 764 | 152371200 | ||
166649271 | depressed_ontop | G | Aug. 2, 2022, 4:45 a.m. | OK | Python 3 | TESTS | 20 | 1777 | 249856000 | ||
166610215 | kena0ki | G | Aug. 1, 2022, 5:57 p.m. | OK | Rust 2021 | TESTS | 20 | 155 | 59392000 | ||
166604851 | robostac | G | Aug. 1, 2022, 5:16 p.m. | OK | Rust 2021 | TESTS | 20 | 265 | 170905600 | ||
166605016 | robostac | G | Aug. 1, 2022, 5:17 p.m. | OK | Rust 2021 | TESTS | 20 | 280 | 170905600 | ||
166602802 | robostac | G | Aug. 1, 2022, 5:04 p.m. | OK | Rust 2021 | TESTS | 20 | 312 | 229785600 | ||
166608345 | gloria_mundi | G | Aug. 1, 2022, 5:42 p.m. | OK | Rust 2021 | TESTS | 20 | 373 | 14438400 |
Back to search problems