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 |
|---|---|---|---|---|---|---|
| 587 | Codeforces Round 326 (Div. 1) | FINISHED | False | 9000 | 331479023 | Oct. 15, 2015, 4:30 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 868 ) | D | Duff in Mafia | PROGRAMMING | 2-sat binary search | 2900 |
Duff is one if the heads of Mafia in her country, Andarz Gu. Andarz Gu has n cities (numbered from 1 to n ) connected by m bidirectional roads (numbered by 1 to m ). Each road has a destructing time, and a color. i -th road connects cities v i and u i and its color is c i and its destructing time is t i . Mafia wants to destruct a matching in Andarz Gu. A matching is a subset of roads such that no two roads in this subset has common endpoint. They can destruct these roads in parallel, i. e. the total destruction time is a maximum over destruction times of all selected roads. They want two conditions to be satisfied: The remaining roads form a proper coloring . Destructing time of this matching is minimized. The remaining roads after destructing this matching form a proper coloring if and only if no two roads of the same color have same endpoint, or, in the other words, edges of each color should form a matching . There is no programmer in Mafia. That's why Duff asked for your help. Please help her and determine which matching to destruct in order to satisfied those conditions (or state that this is not possible). The first line of input contains two integers n and m ( 2 ≤ n ≤ 5 × 10 4 and 1 ≤ m ≤ 5 × 10 4 ), number of cities and number of roads in the country. The next m lines contain the the roads. i - th of them contains four integers v i , u i , c i and t i ( 1 ≤ v i , u i ≤ n , v i ≠ u i and 1 ≤ c i , t i ≤ 10 9 for each 1 ≤ i ≤ m ). In the first line of input, print " Yes " (without quotes) if satisfying the first condition is possible and " No " (without quotes) otherwise. If it is possible, then you have to print two integers t and k in the second line, the minimum destructing time and the number of roads in the matching ( ). In the third line print k distinct integers separated by spaces, indices of the roads in the matching in any order. Roads are numbered starting from one in order of their appearance in the input. If there's more than one soluti |
| Codeforces Round #326 (Editorial) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 13704390 | Vlad_kv | D | Oct. 17, 2015, 9:08 p.m. | OK | GNU C++ | TESTS | 63 | 78 | 5222400 | 2900 | |
| 40985954 | ReaLNero1 | D | July 30, 2018, 8:16 p.m. | OK | GNU C++ | TESTS | 63 | 93 | 5222400 | 2900 | |
| 13704420 | Vlad_kv | D | Oct. 17, 2015, 9:12 p.m. | OK | GNU C++ | TESTS | 63 | 93 | 5222400 | 2900 | |
| 13704414 | Vlad_kv | D | Oct. 17, 2015, 9:11 p.m. | OK | GNU C++ | TESTS | 63 | 93 | 5222400 | 2900 | |
| 13704433 | Vlad_kv | D | Oct. 17, 2015, 9:13 p.m. | OK | GNU C++ | TESTS | 63 | 124 | 5222400 | 2900 | |
| 29243966 | 666sb666 | D | Aug. 6, 2017, 2:51 p.m. | OK | GNU C++ | TESTS | 63 | 249 | 142848000 | 2900 | |
| 14122815 | Ra16bit | D | Nov. 7, 2015, 11:24 a.m. | OK | GNU C++ | TESTS | 63 | 374 | 37478400 | 2900 | |
| 13906785 | ShineRain | D | Oct. 28, 2015, 12:01 a.m. | OK | GNU C++ | TESTS | 63 | 529 | 47104000 | 2900 | |
| 28055875 | jiyutian | D | June 26, 2017, 11:02 a.m. | OK | GNU C++ | TESTS | 63 | 608 | 109875200 | 2900 | |
| 21580096 | GentleSmile | D | Oct. 19, 2016, 12:57 a.m. | OK | GNU C++ | TESTS | 63 | 826 | 40448000 | 2900 | |
| 67505094 | star_magic_young | D | Dec. 24, 2019, 6:51 a.m. | OK | GNU C++11 | TESTS | 63 | 78 | 187596800 | 2900 | |
| 67505054 | star_magic_young | D | Dec. 24, 2019, 6:50 a.m. | OK | GNU C++11 | TESTS | 63 | 78 | 187699200 | 2900 | |
| 13882495 | aaaaajack | D | Oct. 27, 2015, 1:32 a.m. | OK | GNU C++11 | TESTS | 63 | 109 | 14745600 | 2900 | |
| 67402704 | Isonan | D | Dec. 22, 2019, 4:51 a.m. | OK | GNU C++11 | TESTS | 63 | 124 | 55398400 | 2900 | |
| 15168811 | Xhark | D | Jan. 3, 2016, 1:36 p.m. | OK | GNU C++11 | TESTS | 63 | 140 | 12288000 | 2900 | |
| 13653795 | -XraY- | D | Oct. 15, 2015, 8:52 p.m. | OK | GNU C++11 | TESTS | 63 | 171 | 8806400 | 2900 | |
| 35848028 | mengbierr | D | March 2, 2018, 4:51 p.m. | OK | GNU C++11 | TESTS | 63 | 217 | 142745600 | 2900 | |
| 15169557 | iddaga | D | Jan. 3, 2016, 2:43 p.m. | OK | GNU C++11 | TESTS | 63 | 233 | 17715200 | 2900 | |
| 13856598 | Mindyou | D | Oct. 25, 2015, 4:48 p.m. | OK | GNU C++11 | TESTS | 63 | 233 | 25600000 | 2900 | |
| 13653593 | BSBandme | D | Oct. 15, 2015, 8:40 p.m. | OK | GNU C++11 | TESTS | 63 | 234 | 31232000 | 2900 | |
| 66375516 | mayaohua2003 | D | Dec. 6, 2019, 2:26 a.m. | OK | GNU C++14 | TESTS | 63 | 93 | 9932800 | 2900 | |
| 51348060 | P0LyFish | D | March 15, 2019, 7:39 p.m. | OK | GNU C++14 | TESTS | 63 | 124 | 8601600 | 2900 | |
| 62966351 | vjudge5 | D | Oct. 20, 2019, 4:48 a.m. | OK | GNU C++14 | TESTS | 63 | 124 | 16076800 | 2900 | |
| 62966484 | Cyanic | D | Oct. 20, 2019, 4:53 a.m. | OK | GNU C++14 | TESTS | 63 | 139 | 16076800 | 2900 | |
| 63922444 | Rubbish12345 | D | Oct. 31, 2019, 12:07 p.m. | OK | GNU C++14 | TESTS | 63 | 187 | 107827200 | 2900 | |
| 69656726 | sunnuozhou | D | Jan. 28, 2020, 7:47 a.m. | OK | GNU C++14 | TESTS | 63 | 234 | 18534400 | 2900 | |
| 38151155 | kut_kjb1994 | D | May 13, 2018, 2:56 a.m. | OK | GNU C++14 | TESTS | 63 | 296 | 37580800 | 2900 | |
| 37628154 | kut_kjb1994 | D | April 26, 2018, 8:08 a.m. | OK | GNU C++14 | TESTS | 63 | 312 | 37580800 | 2900 | |
| 25673649 | unused | D | March 20, 2017, 5:52 p.m. | OK | GNU C++14 | TESTS | 63 | 436 | 24371200 | 2900 | |
| 69680013 | nealchen | D | Jan. 28, 2020, 3:21 p.m. | OK | GNU C++14 | TESTS | 63 | 530 | 22323200 | 2900 | |
| 64436820 | jokerwyt | D | Nov. 7, 2019, 1:55 a.m. | OK | GNU C++17 | TESTS | 63 | 389 | 139776000 | 2900 | |
| 64435539 | jokerwyt | D | Nov. 7, 2019, 1:01 a.m. | OK | GNU C++17 | TESTS | 63 | 467 | 154214400 | 2900 | |
| 47309011 | vjudge2 | D | Dec. 20, 2018, 6:30 p.m. | OK | GNU C++17 | TESTS | 63 | 483 | 45977600 | 2900 | |
| 54408570 | SamMHD | D | May 20, 2019, 8:10 a.m. | OK | GNU C++17 | TESTS | 63 | 608 | 15360000 | 2900 | |
| 54408694 | SamMHD | D | May 20, 2019, 8:16 a.m. | OK | GNU C++17 | TESTS | 63 | 748 | 15360000 | 2900 | |
| 63059398 | CMXRYNP | D | Oct. 21, 2019, 7:59 a.m. | OK | GNU C++17 | TESTS | 63 | 764 | 40448000 | 2900 | |
| 61232027 | ivan100sic | D | Sept. 24, 2019, 4:54 p.m. | OK | GNU C++17 | TESTS | 63 | 795 | 29900800 | 2900 | |
| 69714430 | skip1978 | D | Jan. 29, 2020, 8:28 a.m. | OK | GNU C++17 | TESTS | 63 | 810 | 48537600 | 2900 | |
| 64526348 | cold_chair | D | Nov. 8, 2019, 1:55 p.m. | OK | GNU C++17 | TESTS | 63 | 811 | 168652800 | 2900 | |
| 68061901 | AM. | D | Jan. 2, 2020, 4:55 a.m. | OK | GNU C++17 | TESTS | 63 | 858 | 30924800 | 2900 | |
| 13896097 | AndreiNet | D | Oct. 27, 2015, 4:41 p.m. | OK | Java 8 | TESTS | 63 | 2230 | 57753600 | 2900 | |
| 13896105 | AndreiNet | D | Oct. 27, 2015, 4:53 p.m. | OK | Java 8 | TESTS | 63 | 2542 | 57753600 | 2900 | |
| 13896104 | AndreiNet | D | Oct. 27, 2015, 4:53 p.m. | OK | Java 8 | TESTS | 63 | 2932 | 57753600 | 2900 | |
| 21698569 | I_love_tigersugar | D | Oct. 23, 2016, 5:37 a.m. | OK | Java 8 | TESTS | 63 | 5350 | 72294400 | 2900 | |
| 14163071 | AlexFetisov | D | Nov. 9, 2015, 1:11 a.m. | OK | Java 8 | TESTS | 63 | 5990 | 239206400 | 2900 | |
| 34691189 | Jose10go | D | Jan. 29, 2018, 9:44 p.m. | OK | MS C# | TESTS | 63 | 3556 | 259481600 | 2900 | |
| 23543521 | Oleg_Smirnov | D | Jan. 4, 2017, 8:28 p.m. | OK | MS C++ | TESTS | 63 | 1153 | 104960000 | 2900 | |
| 23543513 | Oleg_Smirnov | D | Jan. 4, 2017, 8:28 p.m. | OK | MS C++ | TESTS | 63 | 1185 | 105062400 | 2900 |
Back to search problems