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 |
|---|---|---|---|---|---|---|
| 696 | Codeforces Round 362 (Div. 1) | FINISHED | False | 8100 | 307891523 | July 14, 2016, 4:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 626 ) | E | ...Wait for it... | PROGRAMMING | data structures dsu trees | 2900 |
Barney is searching for his dream girl. He lives in NYC. NYC has n junctions numbered from 1 to n and n - 1 roads connecting them. We will consider the NYC as a rooted tree with root being junction 1 . m girls live in NYC, i -th of them lives along junction c i and her weight initially equals i pounds. Barney consider a girl x to be better than a girl y if and only if: girl x has weight strictly less than girl y or girl x and girl y have equal weights and index of girl x living junction index is strictly less than girl y living junction index, i.e. c x < c y . Thus for any two girls one of them is always better than another one. For the next q days, one event happens each day. There are two types of events: Barney goes from junction v to junction u . As a result he picks at most k best girls he still have not invited from junctions on his way and invites them to his house to test if one of them is his dream girl. If there are less than k not invited girls on his path, he invites all of them. Girls living along junctions in subtree of junction v (including v itself) put on some weight. As result, their weights increase by k pounds. Your task is for each event of first type tell Barney the indices of girls he will invite to his home in this event. The first line of input contains three integers n , m and q ( 1 ≤ n , m , q ≤ 10 5 ) — the number of junctions in NYC, the number of girls living in NYC and the number of events respectively. The next n - 1 lines describes the roads. Each line contains two integers v and u ( 1 ≤ v , u ≤ n , v ≠ u ) meaning that there is a road connecting junctions v and u . The next line contains m integers c 1 , c 2 , ..., c m ( 1 ≤ c i ≤ n ) — the girl's living junctions. The next q lines describe the events in chronological order. Each line starts with an integer t ( 1 ≤ t ≤ 2 ) — type of the event . If t = 1 then the line describes event of first type three integers v , u and k ( 1 ≤ v , u , k ≤ n ) follow — the endpoints of Ba |
| Codeforces Round #362 (Editorial) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 26123210 | jiyutian | E | April 4, 2017, 1:31 p.m. | OK | GNU C++ | TESTS | 68 | 358 | 28057600 | 2900 | |
| 26635502 | F.Darcy | E | April 24, 2017, 7:57 a.m. | OK | GNU C++ | TESTS | 68 | 358 | 32153600 | 2900 | |
| 19164217 | SanSiroWaltz | E | July 16, 2016, 2:27 a.m. | OK | GNU C++ | TESTS | 68 | 421 | 25497600 | 2900 | |
| 40984072 | ReaLNero1 | E | July 30, 2018, 7:10 p.m. | OK | GNU C++ | TESTS | 68 | 451 | 30105600 | 2900 | |
| 20958523 | AkaneSasu | E | Sept. 28, 2016, 1:28 a.m. | OK | GNU C++ | TESTS | 68 | 467 | 21094400 | 2900 | |
| 31553523 | Idvzchuscvol | E | Oct. 21, 2017, 6:28 a.m. | OK | GNU C++ | TESTS | 68 | 467 | 32153600 | 2900 | |
| 19942984 | Philipsweng | E | Aug. 18, 2016, 9:02 a.m. | OK | GNU C++ | TESTS | 68 | 482 | 34304000 | 2900 | |
| 19775325 | wangyisong1996 | E | Aug. 11, 2016, 2:08 a.m. | OK | GNU C++ | TESTS | 68 | 483 | 15360000 | 2900 | |
| 19940450 | liaoliao | E | Aug. 18, 2016, 6:02 a.m. | OK | GNU C++ | TESTS | 68 | 483 | 22323200 | 2900 | |
| 19145666 | Hillan | E | July 15, 2016, 7:06 a.m. | OK | GNU C++ | TESTS | 68 | 499 | 53452800 | 2900 | |
| 19181371 | kefaa | E | July 17, 2016, 12:29 a.m. | OK | GNU C++11 | TESTS | 68 | 389 | 33484800 | 2900 | |
| 19192022 | Penny_Lane | E | July 17, 2016, 2:56 p.m. | OK | GNU C++11 | TESTS | 68 | 390 | 55296000 | 2900 | |
| 19192216 | Penny_Lane | E | July 17, 2016, 3:09 p.m. | OK | GNU C++11 | TESTS | 68 | 421 | 60928000 | 2900 | |
| 19128548 | matthew99 | E | July 14, 2016, 6:13 p.m. | OK | GNU C++11 | TESTS | 68 | 436 | 18944000 | 2900 | |
| 19161870 | HellKitsune | E | July 15, 2016, 9:07 p.m. | OK | GNU C++11 | TESTS | 68 | 436 | 26828800 | 2900 | |
| 20367274 | Vlad_kv | E | Sept. 3, 2016, 5:27 p.m. | OK | GNU C++11 | TESTS | 68 | 436 | 27340800 | 2900 | |
| 19380511 | jacobtpl | E | July 24, 2016, 9:03 a.m. | OK | GNU C++11 | TESTS | 68 | 451 | 34611200 | 2900 | |
| 19305297 | _0w0_ | E | July 21, 2016, 3:41 p.m. | OK | GNU C++11 | TESTS | 68 | 452 | 28979200 | 2900 | |
| 19755779 | joey2005 | E | Aug. 9, 2016, 11:45 p.m. | OK | GNU C++11 | TESTS | 68 | 452 | 39526400 | 2900 | |
| 19140362 | shdut | E | July 15, 2016, 2:50 a.m. | OK | GNU C++11 | TESTS | 68 | 468 | 25088000 | 2900 | |
| 29497576 | vjudge4 | E | Aug. 16, 2017, 6:15 a.m. | OK | GNU C++14 | TESTS | 68 | 436 | 49561600 | 2900 | |
| 57148776 | vjudge5 | E | July 16, 2019, 1:57 p.m. | OK | GNU C++14 | TESTS | 68 | 576 | 26316800 | 2900 | |
| 26810970 | RNS_JKS | E | May 3, 2017, 12:57 a.m. | OK | GNU C++14 | TESTS | 68 | 576 | 91033600 | 2900 | |
| 49612884 | hychyc | E | Feb. 8, 2019, 3:28 a.m. | OK | GNU C++14 | TESTS | 68 | 577 | 25088000 | 2900 | |
| 36671470 | TadijaSebez | E | March 27, 2018, 2:46 p.m. | OK | GNU C++14 | TESTS | 68 | 577 | 33587200 | 2900 | |
| 32127729 | Egor.Lifar | E | Nov. 7, 2017, 6:15 p.m. | OK | GNU C++14 | TESTS | 68 | 577 | 35225600 | 2900 | |
| 33263759 | cyz666 | E | Dec. 15, 2017, 12:34 p.m. | OK | GNU C++14 | TESTS | 68 | 592 | 35430400 | 2900 | |
| 57148923 | halfblindprince | E | July 16, 2019, 2 p.m. | OK | GNU C++14 | TESTS | 68 | 623 | 26214400 | 2900 | |
| 69586619 | ragen | E | Jan. 26, 2020, 7:49 p.m. | OK | GNU C++14 | TESTS | 68 | 670 | 25088000 | 2900 | |
| 69953667 | Scut82 | E | Feb. 1, 2020, 9:35 a.m. | OK | GNU C++14 | TESTS | 68 | 670 | 29286400 | 2900 | |
| 66680796 | HeRaNO | E | Dec. 12, 2019, 1:02 p.m. | OK | GNU C++17 | TESTS | 68 | 529 | 22937600 | 2900 | |
| 56141151 | TerCosmicQueen | E | June 27, 2019, 3:24 a.m. | OK | GNU C++17 | TESTS | 68 | 546 | 45056000 | 2900 | |
| 52457487 | vjudge3 | E | April 7, 2019, 12:18 p.m. | OK | GNU C++17 | TESTS | 68 | 561 | 33484800 | 2900 | |
| 56141479 | vjudge2 | E | June 27, 2019, 3:38 a.m. | OK | GNU C++17 | TESTS | 68 | 576 | 45056000 | 2900 | |
| 50687211 | arbitrary_A | E | March 2, 2019, 2:12 p.m. | OK | GNU C++17 | TESTS | 68 | 607 | 144896000 | 2900 | |
| 50594428 | vjudge4 | E | Feb. 28, 2019, 9:20 a.m. | OK | GNU C++17 | TESTS | 68 | 607 | 144896000 | 2900 | |
| 69895606 | hjk1030 | E | Jan. 31, 2020, 11:38 a.m. | OK | GNU C++17 | TESTS | 68 | 639 | 23859200 | 2900 | |
| 61244286 | spatarel | E | Sept. 24, 2019, 10:03 p.m. | OK | GNU C++17 | TESTS | 68 | 685 | 83763200 | 2900 | |
| 69587421 | AliShahali1382 | E | Jan. 26, 2020, 8:16 p.m. | OK | GNU C++17 | TESTS | 68 | 733 | 27955200 | 2900 | |
| 54167081 | lqs2015 | E | May 15, 2019, 9:11 a.m. | OK | GNU C++17 | TESTS | 68 | 733 | 33792000 | 2900 | |
| 19170997 | uwi | E | July 16, 2016, 10:01 a.m. | OK | Java 8 | TESTS | 68 | 920 | 48742400 | 2900 | |
| 19170919 | uwi | E | July 16, 2016, 9:54 a.m. | OK | Java 8 | TESTS | 68 | 1076 | 50278400 | 2900 | |
| 19220340 | IgorKoval | E | July 18, 2016, 10:01 p.m. | OK | Java 8 | TESTS | 68 | 1481 | 66355200 | 2900 | |
| 19220387 | IgorKoval | E | July 18, 2016, 10:08 p.m. | OK | Java 8 | TESTS | 68 | 1497 | 56729600 | 2900 | |
| 19220413 | IgorKoval | E | July 18, 2016, 10:10 p.m. | OK | Java 8 | TESTS | 68 | 1824 | 49459200 | 2900 | |
| 19191239 | azukun | E | July 17, 2016, 1:58 p.m. | OK | MS C# | TESTS | 68 | 1404 | 57856000 | 2900 | |
| 19129036 | waItz7I9 | E | July 14, 2016, 6:17 p.m. | OK | MS C++ | TESTS | 68 | 514 | 33177600 | 2900 | |
| 24186454 | sdya | E | Jan. 27, 2017, 12:07 p.m. | OK | MS C++ | TESTS | 68 | 1154 | 93593600 | 2900 | |
| 26317135 | Los_Angelos_Laycurse | E | April 12, 2017, 12:31 p.m. | OK | MS C++ | TESTS | 68 | 1575 | 31539200 | 2900 | |
| 26317090 | Los_Angelos_Laycurse | E | April 12, 2017, 12:29 p.m. | OK | MS C++ | TESTS | 68 | 1855 | 31539200 | 2900 |
Back to search problems