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 |
---|---|---|---|---|---|---|
1253 | Codeforces Round 600 (Div. 2) | FINISHED | False | 7200 | 157908299 | Nov. 16, 2019, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 9311 ) | D | Harmonious Graph | PROGRAMMING | constructive algorithms dfs and similar ds graphs greedy sortings | 1700 |
B"You're given an undirected graph with n nodes and m edges. Nodes are numbered from 1 to n . The graph is considered harmonious if and only if the following property holds: In other words, in a harmonious graph, if from a node l we can reach a node r through edges ( l < r ), then we should able to reach nodes (l+1), (l+2), ldots, (r-1) too. What is the minimum number of edges we need to add to make the graph harmonious? The first line contains two integers n and m ( 3 <= n <= 200 000 and 1 <= m <= 200 000 ). The i -th of the next m lines contains two integers u_i and v_i ( 1 <= u_i, v_i <= n , u_i neq v_i ), that mean that there's an edge between nodes u and v . It is guaranteed that the given graph is simple (there is no self-loop, and there is at most one edge between every pair of nodes). Print the minimum number of edges we have to add to the graph to make it harmonious. In the first example, the given graph is not harmonious (for instance, 1 < 6 < 7 , node 1 can reach node 7 through the path 1 rightarrow 2 rightarrow 7 , but node 1 can't reach node 6 ). However adding the edge (2, 4) is sufficient to make it harmonious. In the second example, the given graph is already harmonious. "... |
Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
65203208 | daut-dlang | D | Nov. 16, 2019, 4:16 p.m. | OK | D | TESTS | 31 | 217 | 24371200 | 1700 | |
65224360 | iica | D | Nov. 17, 2019, 12:07 a.m. | OK | D | TESTS | 31 | 327 | 53760000 | 1700 | |
65202020 | ruban | D | Nov. 16, 2019, 4:11 p.m. | OK | Delphi | TESTS | 31 | 124 | 187392000 | 1700 | |
68973641 | zsz12251665 | D | Jan. 17, 2020, 7:59 a.m. | OK | FPC | TESTS | 31 | 109 | 1638400 | 1700 | |
65251162 | jschr | D | Nov. 17, 2019, 12:03 p.m. | OK | GNU C11 | TESTS | 31 | 78 | 6348800 | 1700 | |
65248854 | fnoigsh | D | Nov. 17, 2019, 11:24 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 5017600 | 1700 | |
65412108 | BeNoble | D | Nov. 20, 2019, 4:55 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 6246400 | 1700 | |
65227139 | Zars19 | D | Nov. 17, 2019, 2:34 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 2457600 | 1700 | |
66630151 | scimoon | D | Dec. 11, 2019, 10:51 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 2867200 | 1700 | |
66665505 | luogu_bot5 | D | Dec. 12, 2019, 6:56 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 2867200 | 1700 | |
65409836 | EncodeTalker | D | Nov. 20, 2019, 3:20 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 3993600 | 1700 | |
65403125 | EncodeTalker | D | Nov. 20, 2019, 12:43 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 3993600 | 1700 | |
65236030 | CCJCCJCCCJCCJ | D | Nov. 17, 2019, 7:15 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 3993600 | 1700 | |
65800759 | KaiserYang | D | Nov. 27, 2019, 7:19 a.m. | OK | GNU C++11 | TESTS | 31 | 46 | 3993600 | 1700 | |
66633583 | shengzihang | D | Dec. 11, 2019, 12:05 p.m. | OK | GNU C++11 | TESTS | 31 | 46 | 4812800 | 1700 | |
65241966 | BeNoble | D | Nov. 17, 2019, 9:02 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 6246400 | 1700 | |
65210688 | tokitsukaze | D | Nov. 16, 2019, 5:52 p.m. | OK | GNU C++14 | TESTS | 31 | 46 | 3788800 | 1700 | |
65607509 | wleung_bvg | D | Nov. 23, 2019, 9:49 p.m. | OK | GNU C++14 | TESTS | 31 | 61 | 14131200 | 1700 | |
65209382 | 5a6sas | D | Nov. 16, 2019, 5:41 p.m. | OK | GNU C++14 | TESTS | 31 | 78 | 11161600 | 1700 | |
65241198 | BeNoble | D | Nov. 17, 2019, 8:49 a.m. | OK | GNU C++14 | TESTS | 31 | 78 | 14950400 | 1700 | |
65305698 | 201831990439 | D | Nov. 18, 2019, 2:48 p.m. | OK | GNU C++14 | TESTS | 31 | 78 | 32256000 | 1700 | |
65227104 | elitedj | D | Nov. 17, 2019, 2:33 a.m. | OK | GNU C++14 | TESTS | 31 | 93 | 819200 | 1700 | |
65233771 | KisekiPurin2019 | D | Nov. 17, 2019, 6:21 a.m. | OK | GNU C++14 | TESTS | 31 | 93 | 1638400 | 1700 | |
65209342 | iamrakeshri28 | D | Nov. 16, 2019, 5:40 p.m. | OK | GNU C++14 | TESTS | 31 | 93 | 1638400 | 1700 | |
65233807 | KisekiPurin2019 | D | Nov. 17, 2019, 6:22 a.m. | OK | GNU C++14 | TESTS | 31 | 93 | 1638400 | 1700 | |
65245352 | slrkskfzz | D | Nov. 17, 2019, 10:12 a.m. | OK | GNU C++17 | TESTS | 31 | 62 | 819200 | 1700 | |
65225279 | YANGRUZHAO | D | Nov. 17, 2019, 1:10 a.m. | OK | GNU C++17 | TESTS | 31 | 62 | 11161600 | 1700 | |
65218127 | hogeover30 | D | Nov. 16, 2019, 7:26 p.m. | OK | GNU C++17 | TESTS | 31 | 77 | 2457600 | 1700 | |
65481768 | vjudge4 | D | Nov. 21, 2019, 11:53 a.m. | OK | GNU C++17 | TESTS | 31 | 77 | 3993600 | 1700 | |
65301690 | lijiatu | D | Nov. 18, 2019, 1:28 p.m. | OK | GNU C++17 | TESTS | 31 | 77 | 4812800 | 1700 | |
65457185 | bluefi | D | Nov. 20, 2019, 9:31 p.m. | OK | GNU C++17 | TESTS | 31 | 77 | 7168000 | 1700 | |
66168088 | .tx | D | Dec. 2, 2019, 8:48 a.m. | OK | GNU C++17 | TESTS | 31 | 77 | 13619200 | 1700 | |
65293405 | vjudge1 | D | Nov. 18, 2019, 10:37 a.m. | OK | GNU C++17 | TESTS | 31 | 78 | 4812800 | 1700 | |
66405612 | iaNTU | D | Dec. 6, 2019, 1:36 p.m. | OK | GNU C++17 | TESTS | 31 | 78 | 6348800 | 1700 | |
65225232 | YANGRUZHAO | D | Nov. 17, 2019, 1:07 a.m. | OK | GNU C++17 | TESTS | 31 | 78 | 11161600 | 1700 | |
65234722 | maguroguma | D | Nov. 17, 2019, 6:44 a.m. | OK | Go | TESTS | 31 | 139 | 14336000 | 1700 | |
65233963 | maguroguma | D | Nov. 17, 2019, 6:26 a.m. | OK | Go | TESTS | 31 | 139 | 14336000 | 1700 | |
65233193 | maguroguma | D | Nov. 17, 2019, 6:06 a.m. | OK | Go | TESTS | 31 | 249 | 14233600 | 1700 | |
68065826 | u1s1reallycai | D | Jan. 2, 2020, 7:40 a.m. | OK | Go | TESTS | 31 | 529 | 38297600 | 1700 | |
65242092 | Anonymous | D | Nov. 17, 2019, 9:04 a.m. | OK | Java 11 | TESTS | 31 | 202 | 0 | 1700 | |
67649805 | cribabby | D | Dec. 26, 2019, 11:40 a.m. | OK | Java 11 | TESTS | 31 | 218 | 4096000 | 1700 | |
65271150 | nan0S | D | Nov. 17, 2019, 7:51 p.m. | OK | Java 11 | TESTS | 31 | 248 | 2867200 | 1700 | |
65204110 | IslamTalipovTop | D | Nov. 16, 2019, 4:20 p.m. | OK | Java 11 | TESTS | 31 | 265 | 2867200 | 1700 | |
65204797 | Azakarka | D | Nov. 16, 2019, 4:23 p.m. | OK | Java 11 | TESTS | 31 | 296 | 4608000 | 1700 | |
66316012 | machhra | D | Dec. 5, 2019, 1:07 p.m. | OK | Java 11 | TESTS | 31 | 311 | 32256000 | 1700 | |
69273755 | jakejase2 | D | Jan. 21, 2020, 11:48 p.m. | OK | Java 11 | TESTS | 31 | 483 | 75264000 | 1700 | |
68378710 | ZeyadKhattab | D | Jan. 7, 2020, 9:58 p.m. | OK | Java 11 | TESTS | 31 | 499 | 39014400 | 1700 | |
65275086 | elkadymohammed01 | D | Nov. 17, 2019, 11:40 p.m. | OK | Java 11 | TESTS | 31 | 529 | 70451200 | 1700 | |
66619412 | tusharjape007 | D | Dec. 11, 2019, 6:16 a.m. | OK | Java 11 | TESTS | 31 | 530 | 37273600 | 1700 | |
65257470 | beroul | D | Nov. 17, 2019, 1:54 p.m. | OK | Java 8 | TESTS | 31 | 124 | 0 | 1700 | |
65202841 | saurabhs1206 | D | Nov. 16, 2019, 4:14 p.m. | OK | Java 8 | TESTS | 31 | 139 | 0 | 1700 | |
65321011 | In_The_Name_Of_Love | D | Nov. 18, 2019, 7:48 p.m. | OK | Java 8 | TESTS | 31 | 140 | 0 | 1700 | |
65321127 | bluesky111 | D | Nov. 18, 2019, 7:52 p.m. | OK | Java 8 | TESTS | 31 | 140 | 1536000 | 1700 | |
65217834 | insert_cool_handle | D | Nov. 16, 2019, 7:19 p.m. | OK | Java 8 | TESTS | 31 | 155 | 5017600 | 1700 | |
65307126 | KharYusuf | D | Nov. 18, 2019, 3:19 p.m. | OK | Java 8 | TESTS | 31 | 171 | 0 | 1700 | |
65329355 | yaoct | D | Nov. 19, 2019, 4:47 a.m. | OK | Java 8 | TESTS | 31 | 171 | 1638400 | 1700 | |
66418612 | SnowGoose | D | Dec. 6, 2019, 6 p.m. | OK | Java 8 | TESTS | 31 | 186 | 0 | 1700 | |
65333635 | mufaddalnaya | D | Nov. 19, 2019, 7:46 a.m. | OK | Java 8 | TESTS | 31 | 186 | 0 | 1700 | |
65928806 | jxin31415 | D | Nov. 28, 2019, 7:42 p.m. | OK | Java 8 | TESTS | 31 | 186 | 921600 | 1700 | |
65261711 | Spheniscine | D | Nov. 17, 2019, 3:16 p.m. | OK | Kotlin | TESTS | 31 | 187 | 0 | 1700 | |
65261938 | Spheniscine | D | Nov. 17, 2019, 3:20 p.m. | OK | Kotlin | TESTS | 31 | 202 | 0 | 1700 | |
65206808 | kokokochet | D | Nov. 16, 2019, 4:31 p.m. | OK | Kotlin | TESTS | 31 | 202 | 3072000 | 1700 | |
65207308 | satyamcse | D | Nov. 16, 2019, 4:33 p.m. | OK | Kotlin | TESTS | 31 | 592 | 50483200 | 1700 | |
65205344 | ZakoylovIlya | D | Nov. 16, 2019, 4:25 p.m. | OK | Kotlin | TESTS | 31 | 732 | 25292800 | 1700 | |
65209346 | ZakoylovIlya | D | Nov. 16, 2019, 5:41 p.m. | OK | Kotlin | TESTS | 31 | 873 | 43417600 | 1700 | |
65206148 | artworks | D | Nov. 16, 2019, 4:28 p.m. | OK | Mono C# | TESTS | 31 | 217 | 21504000 | 1700 | |
65204575 | DM7PvTyc | D | Nov. 16, 2019, 4:22 p.m. | OK | Mono C# | TESTS | 31 | 217 | 22323200 | 1700 | |
65542958 | hyzhangzhy | D | Nov. 22, 2019, 4:10 p.m. | OK | Mono C# | TESTS | 31 | 233 | 16896000 | 1700 | |
65540041 | tomomo2b2 | D | Nov. 22, 2019, 3:26 p.m. | OK | Mono C# | TESTS | 31 | 295 | 36966400 | 1700 | |
65494700 | nastya1199 | D | Nov. 21, 2019, 4:06 p.m. | OK | Mono C# | TESTS | 31 | 358 | 20377600 | 1700 | |
65210925 | ololonso | D | Nov. 16, 2019, 5:55 p.m. | OK | Mono C# | TESTS | 31 | 420 | 22220800 | 1700 | |
65555219 | tihoson | D | Nov. 22, 2019, 9:13 p.m. | OK | Mono C# | TESTS | 31 | 421 | 25600000 | 1700 | |
65957806 | tomomo2b2 | D | Nov. 29, 2019, 1:31 p.m. | OK | Mono C# | TESTS | 31 | 467 | 24883200 | 1700 | |
65579447 | vjudge4 | D | Nov. 23, 2019, 10:32 a.m. | OK | MS C++ | TESTS | 31 | 77 | 1945600 | 1700 | |
65617905 | vjudge1 | D | Nov. 24, 2019, 4:54 a.m. | OK | MS C++ | TESTS | 31 | 77 | 1945600 | 1700 | |
65581091 | vjudge4 | D | Nov. 23, 2019, 11:02 a.m. | OK | MS C++ | TESTS | 31 | 77 | 1945600 | 1700 | |
65616010 | vjudge2 | D | Nov. 24, 2019, 3:40 a.m. | OK | MS C++ | TESTS | 31 | 77 | 2048000 | 1700 | |
66491719 | vjudge4 | D | Dec. 8, 2019, 8:48 a.m. | OK | MS C++ | TESTS | 31 | 78 | 3584000 | 1700 | |
66493352 | vjudge2 | D | Dec. 8, 2019, 9:25 a.m. | OK | MS C++ | TESTS | 31 | 140 | 3993600 | 1700 | |
66313044 | vjudge3 | D | Dec. 5, 2019, 12:06 p.m. | OK | MS C++ | TESTS | 31 | 265 | 2048000 | 1700 | |
65562069 | vjudge3 | D | Nov. 23, 2019, 3:36 a.m. | OK | MS C++ | TESTS | 31 | 295 | 2764800 | 1700 | |
66785505 | vjudge3 | D | Dec. 13, 2019, 1:31 p.m. | OK | MS C++ | TESTS | 31 | 295 | 8806400 | 1700 | |
66784884 | vjudge5 | D | Dec. 13, 2019, 1:19 p.m. | OK | MS C++ | TESTS | 31 | 296 | 8806400 | 1700 | |
65554437 | RubyStone | D | Nov. 22, 2019, 8:39 p.m. | OK | MS C++ 2017 | TESTS | 31 | 46 | 2048000 | 1700 | |
65301012 | tyx_cnyali | D | Nov. 18, 2019, 1:15 p.m. | OK | MS C++ 2017 | TESTS | 31 | 109 | 7782400 | 1700 | |
65423371 | vjudge4 | D | Nov. 20, 2019, 9:49 a.m. | OK | MS C++ 2017 | TESTS | 31 | 124 | 2048000 | 1700 | |
65597130 | Tiko | D | Nov. 23, 2019, 4:22 p.m. | OK | MS C++ 2017 | TESTS | 31 | 124 | 2457600 | 1700 | |
65293225 | 1813004846 | D | Nov. 18, 2019, 10:33 a.m. | OK | MS C++ 2017 | TESTS | 31 | 139 | 2764800 | 1700 | |
66297241 | catplatypus | D | Dec. 5, 2019, 5:11 a.m. | OK | MS C++ 2017 | TESTS | 31 | 171 | 10649600 | 1700 | |
68129333 | vjudge4 | D | Jan. 3, 2020, 4:25 p.m. | OK | MS C++ 2017 | TESTS | 31 | 327 | 2048000 | 1700 | |
65663215 | vjudge2 | D | Nov. 24, 2019, 1:14 p.m. | OK | MS C++ 2017 | TESTS | 31 | 327 | 2048000 | 1700 | |
65229771 | efyjef | D | Nov. 17, 2019, 4:16 a.m. | OK | MS C++ 2017 | TESTS | 31 | 327 | 2048000 | 1700 | |
65663152 | Qingyu05300 | D | Nov. 24, 2019, 1:13 p.m. | OK | MS C++ 2017 | TESTS | 31 | 327 | 2252800 | 1700 | |
65282769 | zdbtxdy | D | Nov. 18, 2019, 6:47 a.m. | OK | PyPy 2 | TESTS | 31 | 374 | 21401600 | 1700 | |
65227222 | Mukundan314 | D | Nov. 17, 2019, 2:37 a.m. | OK | PyPy 2 | TESTS | 31 | 405 | 14540800 | 1700 | |
65217162 | Leendertz | D | Nov. 16, 2019, 7:03 p.m. | OK | PyPy 3 | TESTS | 31 | 326 | 11264000 | 1700 | |
65411977 | codershuvo | D | Nov. 20, 2019, 4:50 a.m. | OK | PyPy 3 | TESTS | 31 | 374 | 12185600 | 1700 | |
65411817 | codershuvo | D | Nov. 20, 2019, 4:45 a.m. | OK | PyPy 3 | TESTS | 31 | 545 | 11571200 | 1700 | |
65505424 | hatake_ | D | Nov. 21, 2019, 9:57 p.m. | OK | PyPy 3 | TESTS | 31 | 576 | 21708800 | 1700 | |
65505404 | hatake_ | D | Nov. 21, 2019, 9:56 p.m. | OK | PyPy 3 | TESTS | 31 | 576 | 152371200 | 1700 | |
65256433 | titia | D | Nov. 17, 2019, 1:33 p.m. | OK | PyPy 3 | TESTS | 31 | 577 | 13312000 | 1700 | |
65275681 | juppy | D | Nov. 18, 2019, 12:40 a.m. | OK | PyPy 3 | TESTS | 31 | 608 | 22118400 | 1700 | |
65247288 | zapdospops | D | Nov. 17, 2019, 10:52 a.m. | OK | PyPy 3 | TESTS | 31 | 624 | 32153600 | 1700 | |
66220267 | cftt | D | Dec. 3, 2019, 10:34 a.m. | OK | PyPy 3 | TESTS | 31 | 654 | 11264000 | 1700 | |
65225649 | Kiri8128 | D | Nov. 17, 2019, 1:30 a.m. | OK | PyPy 3 | TESTS | 31 | 654 | 17100800 | 1700 | |
65216686 | nwi | D | Nov. 16, 2019, 6:51 p.m. | OK | Python 2 | TESTS | 31 | 514 | 21708800 | 1700 | |
65347904 | SalmonTimo | D | Nov. 19, 2019, 1:14 p.m. | OK | Python 3 | TESTS | 31 | 701 | 27443200 | 1700 | |
65639908 | petushny | D | Nov. 24, 2019, 8:54 a.m. | OK | Python 3 | TESTS | 31 | 748 | 20787200 | 1700 | |
65688217 | mdaw | D | Nov. 25, 2019, 2:26 a.m. | OK | Python 3 | TESTS | 31 | 779 | 21094400 | 1700 | |
65315825 | Parag_AP | D | Nov. 18, 2019, 5:15 p.m. | OK | Python 3 | TESTS | 31 | 795 | 20992000 | 1700 | |
66972613 | sruthi_1729 | D | Dec. 15, 2019, 1:39 p.m. | OK | Python 3 | TESTS | 31 | 795 | 21299200 | 1700 | |
65688086 | mdaw | D | Nov. 25, 2019, 2:20 a.m. | OK | Python 3 | TESTS | 31 | 919 | 21401600 | 1700 | |
65688078 | mdaw | D | Nov. 25, 2019, 2:19 a.m. | OK | Python 3 | TESTS | 31 | 951 | 21401600 | 1700 | |
66138779 | youdit | D | Dec. 1, 2019, 1:27 p.m. | OK | Python 3 | TESTS | 31 | 982 | 21708800 | 1700 | |
65688048 | mdaw | D | Nov. 25, 2019, 2:18 a.m. | OK | Python 3 | TESTS | 31 | 982 | 21708800 | 1700 | |
66188971 | icaro | D | Dec. 2, 2019, 3:38 p.m. | OK | Python 3 | TESTS | 31 | 982 | 185958400 | 1700 | |
67410138 | gearjack | D | Dec. 22, 2019, 8 a.m. | OK | Rust | TESTS | 31 | 62 | 8499200 | 1700 |
Back to search problems