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 |
|---|---|---|---|---|---|---|
| 603 | Codeforces Round 334 (Div. 1) | FINISHED | False | 7200 | 327421523 | Dec. 1, 2015, 3:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1539 ) | E | Pastoral Oddities | PROGRAMMING | data structures divide and conquer dsu math trees | 2900 |
In the land of Bovinia there are n pastures, but no paths connecting the pastures. Of course, this is a terrible situation, so Kevin Sun is planning to rectify it by constructing m undirected paths connecting pairs of distinct pastures. To make transportation more efficient, he also plans to pave some of these new paths. Kevin is very particular about certain aspects of path-paving. Since he loves odd numbers, he wants each pasture to have an odd number of paved paths connected to it. Thus we call a paving sunny if each pasture is incident to an odd number of paved paths. He also enjoys short paths more than long paths, so he would like the longest paved path to be as short as possible. After adding each path, Kevin wants to know if a sunny paving exists for the paths of Bovinia, and if at least one does, the minimum possible length of the longest path in such a paving. Note that "longest path" here means maximum-weight edge. The first line contains two integers n ( 2 ≤ n ≤ 100 000 ) and m ( 1 ≤ m ≤ 300 000 ), denoting the number of pastures and paths, respectively. The next m lines each contain three integers a i , b i and l i , describing the i -th path. The i -th path connects pastures a i and b i ( 1 ≤ a i , b i ≤ n ; a i ≠ b i ) and has length l i ( 1 ≤ l i ≤ 10 9 ). Paths are given in the order in which they are constructed. Output m lines. The i -th line should contain a single integer denoting the minimum possible length of the longest path (maximum-weight edge) in a sunny paving using only the first i paths. If Kevin cannot pave a set of paths so that each pasture is incident to an odd number of paved paths, output - 1 . Note that the paving is only hypothetical—your answer after adding the i -th path should not be affected by any of your previous answers. For the first sample, these are the paths that Kevin should pave after building the i -th path: No set of paths works. Paths 1 (length 4 ) and 2 (length 8 ). Paths 1 (length 4 ) and 2 (length 8 |
| Codeforces Round #334 Bonus Editorial: More Ideas on Div. 1 E |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 27983221 | lyx_cjz | E | June 23, 2017, 11:10 a.m. | OK | GNU C++ | TESTS | 110 | 483 | 66252800 | 2900 | |
| 35895956 | _____k_____ | E | March 3, 2018, 4:57 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35895369 | ______n______ | E | March 3, 2018, 4:41 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35895113 | ______u______ | E | March 3, 2018, 4:35 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35895091 | _____i_____ | E | March 3, 2018, 4:35 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35886729 | ______h______ | E | March 3, 2018, 1:51 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35886289 | ______k______ | E | March 3, 2018, 1:43 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35885457 | ______i______ | E | March 3, 2018, 1:28 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 35883532 | ______M______ | E | March 3, 2018, 12:56 p.m. | OK | GNU C++ | TESTS | 110 | 499 | 66355200 | 2900 | |
| 27668022 | a13223400732 | E | June 8, 2017, 9:40 a.m. | OK | GNU C++ | TESTS | 110 | 545 | 14438400 | 2900 | |
| 50685012 | 207M | E | March 2, 2019, 1:16 p.m. | OK | GNU C++11 | TESTS | 110 | 436 | 129843200 | 2900 | |
| 50685042 | luogu_bot5 | E | March 2, 2019, 1:17 p.m. | OK | GNU C++11 | TESTS | 110 | 452 | 129843200 | 2900 | |
| 66745490 | XieRujian | E | Dec. 13, 2019, 1:44 a.m. | OK | GNU C++11 | TESTS | 110 | 467 | 19865600 | 2900 | |
| 44725363 | emoairx | E | Oct. 23, 2018, 7:48 a.m. | OK | GNU C++11 | TESTS | 110 | 468 | 64204800 | 2900 | |
| 45697217 | RNS_MHB | E | Nov. 14, 2018, 4:56 a.m. | OK | GNU C++11 | TESTS | 110 | 483 | 9216000 | 2900 | |
| 57594933 | vjudge3 | E | July 23, 2019, 1:36 p.m. | OK | GNU C++11 | TESTS | 110 | 483 | 10035200 | 2900 | |
| 57594884 | chengyufeng | E | July 23, 2019, 1:35 p.m. | OK | GNU C++11 | TESTS | 110 | 483 | 10035200 | 2900 | |
| 65524975 | boshi | E | Nov. 22, 2019, 10 a.m. | OK | GNU C++11 | TESTS | 110 | 483 | 18329600 | 2900 | |
| 27904769 | miaom | E | June 19, 2017, 12:41 p.m. | OK | GNU C++11 | TESTS | 110 | 499 | 10035200 | 2900 | |
| 50993908 | 1505125851 | E | March 8, 2019, 1:50 a.m. | OK | GNU C++11 | TESTS | 110 | 514 | 15257600 | 2900 | |
| 40985595 | ReaLNero1 | E | July 30, 2018, 8:02 p.m. | OK | GNU C++14 | TESTS | 110 | 436 | 18432000 | 2900 | |
| 38778227 | Marco_L_T | E | May 30, 2018, 3:33 p.m. | OK | GNU C++14 | TESTS | 110 | 436 | 21811200 | 2900 | |
| 38778416 | Marco_L_T | E | May 30, 2018, 3:39 p.m. | OK | GNU C++14 | TESTS | 110 | 452 | 21811200 | 2900 | |
| 31628356 | Merln | E | Oct. 23, 2017, 12:24 p.m. | OK | GNU C++14 | TESTS | 110 | 514 | 15769600 | 2900 | |
| 58951498 | Scut82 | E | Aug. 17, 2019, 11:10 a.m. | OK | GNU C++14 | TESTS | 110 | 592 | 25907200 | 2900 | |
| 43167028 | linkfqy | E | Sept. 21, 2018, 5:47 a.m. | OK | GNU C++14 | TESTS | 110 | 623 | 15462400 | 2900 | |
| 58951267 | Scut82 | E | Aug. 17, 2019, 11:05 a.m. | OK | GNU C++14 | TESTS | 110 | 639 | 16384000 | 2900 | |
| 43169751 | linkfqy | E | Sept. 21, 2018, 7:34 a.m. | OK | GNU C++14 | TESTS | 110 | 655 | 16793600 | 2900 | |
| 48095483 | Leonidas | E | Jan. 8, 2019, 4:32 p.m. | OK | GNU C++14 | TESTS | 110 | 670 | 14950400 | 2900 | |
| 32828934 | Timsei | E | Dec. 1, 2017, 12:03 p.m. | OK | GNU C++14 | TESTS | 110 | 686 | 17100800 | 2900 | |
| 53015083 | alonefight | E | April 19, 2019, 1:50 p.m. | OK | GNU C++17 | TESTS | 110 | 655 | 11980800 | 2900 | |
| 68710594 | alan_cty | E | Jan. 13, 2020, 12:52 p.m. | OK | GNU C++17 | TESTS | 110 | 748 | 52121600 | 2900 | |
| 69942252 | hjk1030 | E | Feb. 1, 2020, 6:31 a.m. | OK | GNU C++17 | TESTS | 110 | 842 | 81203200 | 2900 | |
| 69935951 | jah_melon | E | Feb. 1, 2020, 3:45 a.m. | OK | GNU C++17 | TESTS | 110 | 936 | 140083200 | 2900 | |
| 64364205 | Elegia | E | Nov. 6, 2019, 12:34 p.m. | OK | GNU C++17 | TESTS | 110 | 1247 | 23142400 | 2900 | |
| 68303659 | ruo | E | Jan. 6, 2020, 8:01 a.m. | OK | GNU C++17 | TESTS | 110 | 1340 | 20992000 | 2900 | |
| 64859760 | cjy2003 | E | Nov. 14, 2019, 2:18 a.m. | OK | GNU C++17 | TESTS | 110 | 1372 | 21811200 | 2900 | |
| 63895937 | Lucky_Glass | E | Oct. 31, 2019, 1:58 a.m. | OK | GNU C++17 | TESTS | 110 | 1403 | 26931200 | 2900 | |
| 63896112 | Lucky_Glass | E | Oct. 31, 2019, 2:05 a.m. | OK | GNU C++17 | TESTS | 110 | 1419 | 26726400 | 2900 | |
| 63900147 | Lucky_Glass | E | Oct. 31, 2019, 4:51 a.m. | OK | GNU C++17 | TESTS | 110 | 1450 | 26726400 | 2900 | |
| 14603895 | Petr | E | Dec. 1, 2015, 5:47 p.m. | OK | Java 7 | TESTS | 110 | 592 | 38912000 | 2900 | |
| 14669504 | mmaxio | E | Dec. 5, 2015, 9:45 p.m. | OK | Java 8 | TESTS | 110 | 1388 | 15769600 | 2900 | |
| 14694682 | IamGannaWinACM | E | Dec. 8, 2015, 7:22 a.m. | OK | Java 8 | TESTS | 110 | 1435 | 15769600 | 2900 | |
| 14828359 | AlexFetisov | E | Dec. 15, 2015, 11:57 p.m. | OK | Java 8 | TESTS | 110 | 2246 | 71168000 | 2900 | |
| 14828390 | AlexFetisov | E | Dec. 16, 2015, 12:04 a.m. | OK | Java 8 | TESTS | 110 | 2401 | 71168000 | 2900 | |
| 15156399 | OnionPringles | E | Jan. 2, 2016, 8:50 a.m. | OK | MS C++ | TESTS | 110 | 873 | 18432000 | 2900 | |
| 44167779 | vjudge1 | E | Oct. 12, 2018, 3:15 a.m. | OK | MS C++ | TESTS | 110 | 936 | 75059200 | 2900 | |
| 62094771 | vjudge2 | E | Oct. 8, 2019, 7:06 a.m. | OK | MS C++ | TESTS | 110 | 950 | 75059200 | 2900 | |
| 43994578 | vjudge4 | E | Oct. 8, 2018, 10:51 a.m. | OK | MS C++ | TESTS | 110 | 1123 | 74956800 | 2900 |
Back to search problems