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 |
---|---|---|---|---|---|---|
1515 | Codeforces Global Round 14 | FINISHED | False | 10800 | 117213863 | May 2, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1850 ) | F | Phoenix and Earthquake | PROGRAMMING | constructive algorithms dfs and similar ds graphs greedy trees |
B"Phoenix's homeland, the Fire Nation had n cities that were connected by m roads, but the roads were all destroyed by an earthquake. The Fire Nation wishes to repair n-1 of these roads so that all the cities are connected again. The i -th city has a_i tons of asphalt. x tons of asphalt are used up when repairing a road, and to repair a road between i and j , cities i and j must have at least x tons of asphalt between them. In other words, if city i had a_i tons of asphalt and city j had a_j tons, there would remain a_i+a_j-x tons after repairing the road between them. Asphalt can be moved between cities if the road between them is already repaired. Please determine if it is possible to connect all the cities, and if so, output any sequence of roads to repair. The first line contains integers n , m , and x ( 2 <= n <= 3 cdot 10^5 ; n-1 <= m <= 3 cdot 10^5 ; 1 <= x <= 10^9 ) -- the number of cities, number of roads, and amount of asphalt needed to repair one road. The next line contains n space-separated integer a_i ( 0 <= a_i <= 10^9 ) -- the amount of asphalt initially at city i . The next m lines contains two integers x_i and y_i ( x_i ne y_i ; 1 <= x_i, y_i <= n ) -- the cities connected by the i -th road. It is guaranteed that there is at most one road between each pair of cities, and that the city was originally connected before the earthquake. If it is not possible to connect all the cities, print NO. Otherwise, print YES followed by n-1 integers e_1, e_2, ... , e_{n-1} , the order in which the roads should be repaired. e_i is the index of the i -th road to repair. If there are multiple solutions, print any. In the first example, the roads are repaired in the following order: In the second example, cities 1 and 2 use all the"... |
Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
114980464 | AThousandMoon | F | May 3, 2021, 2:23 a.m. | OK | GNU C++11 | TESTS | 94 | 140 | 29593600 | ||
114982253 | xgzc | F | May 3, 2021, 3:01 a.m. | OK | GNU C++11 | TESTS | 94 | 140 | 29798400 | ||
114984456 | zeyuguo | F | May 3, 2021, 3:39 a.m. | OK | GNU C++11 | TESTS | 94 | 171 | 29593600 | ||
114978412 | yzx1798106406 | F | May 3, 2021, 1:35 a.m. | OK | GNU C++11 | TESTS | 94 | 187 | 25292800 | ||
114982359 | Social_Zhao | F | May 3, 2021, 3:03 a.m. | OK | GNU C++11 | TESTS | 94 | 187 | 43315200 | ||
114980063 | luogu_bot5 | F | May 3, 2021, 2:14 a.m. | OK | GNU C++11 | TESTS | 94 | 233 | 24371200 | ||
114976938 | DisorderedBubble | F | May 3, 2021, 12:52 a.m. | OK | GNU C++11 | TESTS | 94 | 233 | 24371200 | ||
114992644 | xiaoziyao | F | May 3, 2021, 5:23 a.m. | OK | GNU C++11 | TESTS | 94 | 234 | 32256000 | ||
114981459 | ix35 | F | May 3, 2021, 2:46 a.m. | OK | GNU C++11 | TESTS | 94 | 234 | 32563200 | ||
114981159 | Capitalist_Wang | F | May 3, 2021, 2:39 a.m. | OK | GNU C++11 | TESTS | 94 | 249 | 28876800 | ||
114989203 | Ripiaun | F | May 3, 2021, 4:45 a.m. | OK | GNU C++14 | TESTS | 94 | 373 | 35020800 | ||
114980203 | tzxydby | F | May 3, 2021, 2:17 a.m. | OK | GNU C++14 | TESTS | 94 | 374 | 37478400 | ||
114975027 | AlanSkarica | F | May 2, 2021, 11:42 p.m. | OK | GNU C++14 | TESTS | 94 | 374 | 42291200 | ||
114976958 | Vectors_Master | F | May 3, 2021, 12:52 a.m. | OK | GNU C++14 | TESTS | 94 | 389 | 56115200 | ||
114983873 | cscsc | F | May 3, 2021, 3:30 a.m. | OK | GNU C++14 | TESTS | 94 | 390 | 41676800 | ||
114955498 | hank55663 | F | May 2, 2021, 5:25 p.m. | OK | GNU C++14 | TESTS | 94 | 405 | 77619200 | ||
114953965 | espr1t | F | May 2, 2021, 5:19 p.m. | OK | GNU C++14 | TESTS | 94 | 421 | 38195200 | ||
114977078 | AhoCorasick | F | May 3, 2021, 12:56 a.m. | OK | GNU C++14 | TESTS | 94 | 436 | 37376000 | ||
114977051 | AhoCorasick | F | May 3, 2021, 12:55 a.m. | OK | GNU C++14 | TESTS | 94 | 451 | 47001600 | ||
114962042 | SuperJ6 | F | May 2, 2021, 6:59 p.m. | OK | GNU C++14 | TESTS | 94 | 467 | 27648000 | ||
114962666 | iaNTU | F | May 2, 2021, 7:05 p.m. | OK | GNU C++17 | TESTS | 94 | 295 | 49766400 | ||
114974665 | emuyumi | F | May 2, 2021, 11:29 p.m. | OK | GNU C++17 | TESTS | 94 | 327 | 27238400 | ||
114976678 | Flying2021 | F | May 3, 2021, 12:43 a.m. | OK | GNU C++17 | TESTS | 94 | 342 | 34816000 | ||
114967779 | faresbasbas | F | May 2, 2021, 8:22 p.m. | OK | GNU C++17 | TESTS | 94 | 343 | 33894400 | ||
114962120 | spacewalker | F | May 2, 2021, 7 p.m. | OK | GNU C++17 | TESTS | 94 | 374 | 31334400 | ||
114977972 | maomao90 | F | May 3, 2021, 1:23 a.m. | OK | GNU C++17 | TESTS | 94 | 374 | 38912000 | ||
114989230 | Ripiaun | F | May 3, 2021, 4:45 a.m. | OK | GNU C++17 | TESTS | 94 | 389 | 35020800 | ||
114980475 | DiTenix | F | May 3, 2021, 2:24 a.m. | OK | GNU C++17 | TESTS | 94 | 390 | 42291200 | ||
114970932 | Mamedov | F | May 2, 2021, 9:33 p.m. | OK | GNU C++17 | TESTS | 94 | 405 | 35225600 | ||
114972583 | Igorjan94 | F | May 2, 2021, 10:22 p.m. | OK | GNU C++17 | TESTS | 94 | 420 | 26521600 | ||
114969086 | Nanored | F | May 2, 2021, 8:47 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 326 | 29593600 | ||
114980312 | WeakestTopology | F | May 3, 2021, 2:20 a.m. | OK | GNU C++17 (64) | TESTS | 94 | 327 | 53862400 | ||
114989254 | Ripiaun | F | May 3, 2021, 4:45 a.m. | OK | GNU C++17 (64) | TESTS | 94 | 342 | 48128000 | ||
114975686 | SorahISA | F | May 3, 2021, 12:07 a.m. | OK | GNU C++17 (64) | TESTS | 94 | 343 | 67788800 | ||
114985052 | Maripium | F | May 3, 2021, 3:48 a.m. | OK | GNU C++17 (64) | TESTS | 94 | 374 | 63692800 | ||
114951756 | 1-gon | F | May 2, 2021, 5:10 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 405 | 84275200 | ||
114951543 | 255 | F | May 2, 2021, 5:09 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 405 | 92262400 | ||
114960479 | mtsd | F | May 2, 2021, 6:48 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 405 | 101990400 | ||
114972746 | ScarletS | F | May 2, 2021, 10:27 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 420 | 48230400 | ||
114955588 | nweeks | F | May 2, 2021, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 94 | 420 | 75980800 | ||
114969570 | Dukkha | F | May 2, 2021, 8:57 p.m. | OK | Java 11 | TESTS | 94 | 1278 | 5324800 | ||
114984907 | lucasr | F | May 3, 2021, 3:46 a.m. | OK | Java 11 | TESTS | 94 | 1965 | 106496000 | ||
114975640 | sylvyrfysh | F | May 3, 2021, 12:06 a.m. | OK | Kotlin | TESTS | 94 | 1356 | 111718400 | ||
114956142 | Hakiobo | F | May 2, 2021, 5:28 p.m. | OK | Kotlin | TESTS | 94 | 1981 | 139366400 | ||
114968213 | P___ | F | May 2, 2021, 8:30 p.m. | OK | MS C++ 2017 | TESTS | 94 | 1028 | 47513600 | ||
114963806 | kclee2172 | F | May 2, 2021, 7:18 p.m. | OK | PyPy 3 | TESTS | 94 | 1231 | 109772800 | ||
114990331 | sh1194 | F | May 3, 2021, 4:59 a.m. | OK | Python 3 | TESTS | 94 | 2636 | 110899200 | ||
114991305 | sh1194 | F | May 3, 2021, 5:09 a.m. | OK | Python 3 | TESTS | 94 | 2744 | 104345600 | ||
114990924 | sh1194 | F | May 3, 2021, 5:05 a.m. | OK | Python 3 | TESTS | 94 | 2776 | 104243200 | ||
114991488 | sh1194 | F | May 3, 2021, 5:11 a.m. | OK | Python 3 | TESTS | 94 | 2792 | 104345600 | ||
114990704 | sh1194 | F | May 3, 2021, 5:03 a.m. | OK | Python 3 | TESTS | 94 | 2792 | 105574400 | ||
114986536 | toomer | F | May 3, 2021, 4:09 a.m. | OK | Rust | TESTS | 94 | 202 | 45158400 | ||
114950484 | sansen | F | May 2, 2021, 5:05 p.m. | OK | Rust | TESTS | 94 | 390 | 57856000 |
Back to search problems