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 |
---|---|---|---|---|---|---|
1851 | Codeforces Round 888 (Div. 3) | FINISHED | False | 8100 | 41527499 | July 25, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 3293 ) | G | Vlad and the Mountains | PROGRAMMING | data structures ds graphs implementation sortings trees two pointers |
B'Vlad decided to go on a trip to the mountains. He plans to move between n mountains, some of which are connected by roads. The i -th mountain has a height of h_i . If there is a road between mountains i and j , Vlad can move from mountain i to mountain j by spending h_j - h_i units of energy. If his energy drops below zero during the transition, he will not be able to move from mountain i to mountain j . Note that h_j - h_i can be negative and then the energy will be restored. Vlad wants to consider different route options, so he asks you to answer the following queries: is it possible to construct some route starting at mountain a and ending at mountain b , given that he initially has e units of energy? The first line of the input contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The descriptions of the test cases follow. The first line of each test case contains two numbers n and m ( 2 <= n <= 2 cdot 10^5 , 1 <= m <= min( frac{n cdot(n - 1)}{2}, 2 cdot 10^5) ) -- the number of mountains and the number of roads between them, respectively. The second line contains n integers h_1, h_2, h_3, ... , h_n ( 1 <= h_i <= 10^9 ) -- the heights of the mountains. The next m lines contain two integers u and v ( 1 <= u, v <= n , u ne v ) -- the numbers of the mountains connected by a road. It is guaranteed that no road appears twice. The next line contains an integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of queries. The following q lines contain three numbers a , b , and e ( 1 <= a, b <= n , 0 <= e <= 10^9 ) -- the initial and final mountains of the route, and the amount of energy, respectively. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . The same guarantee applies to $'... |
118667 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
215621337 | pengin_2000 | G | July 25, 2023, 4:55 p.m. | OK | GNU C11 | TESTS | 22 | 1747 | 24064000 | ||
215666291 | ZhangwuKitten | G | July 26, 2023, 3:02 a.m. | OK | GNU C++14 | TESTS | 22 | 295 | 8192000 | ||
215635838 | pretty_butterfly | G | July 25, 2023, 6:32 p.m. | OK | GNU C++14 | TESTS | 22 | 296 | 7987200 | ||
215679254 | lhyuu | G | July 26, 2023, 5:46 a.m. | OK | GNU C++14 | TESTS | 22 | 311 | 7270400 | ||
215657848 | hbs | G | July 26, 2023, 1:10 a.m. | OK | GNU C++14 | TESTS | 22 | 312 | 7987200 | ||
215639947 | The-Winner | G | July 25, 2023, 7:18 p.m. | OK | GNU C++14 | TESTS | 22 | 327 | 15257600 | ||
215627571 | TrendBattles | G | July 25, 2023, 5:26 p.m. | OK | GNU C++14 | TESTS | 22 | 343 | 8806400 | ||
215666208 | Oyasumi33 | G | July 26, 2023, 3:01 a.m. | OK | GNU C++14 | TESTS | 22 | 343 | 8806400 | ||
215656107 | RemBinary | G | July 26, 2023, 12:33 a.m. | OK | GNU C++14 | TESTS | 22 | 343 | 12595200 | ||
215676002 | Sheryang | G | July 26, 2023, 5:07 a.m. | OK | GNU C++14 | TESTS | 22 | 358 | 44134400 | ||
215625202 | PCC | G | July 25, 2023, 5:12 p.m. | OK | GNU C++14 | TESTS | 22 | 374 | 18227200 | ||
215673376 | gn_wz | G | July 26, 2023, 4:32 a.m. | OK | GNU C++17 | TESTS | 22 | 295 | 7270400 | ||
215651079 | Kinan | G | July 25, 2023, 10:12 p.m. | OK | GNU C++17 | TESTS | 22 | 327 | 20582400 | ||
215663650 | Www123456 | G | July 26, 2023, 2:32 a.m. | OK | GNU C++17 | TESTS | 22 | 343 | 7987200 | ||
215625994 | Rosmontispes | G | July 25, 2023, 5:16 p.m. | OK | GNU C++17 | TESTS | 22 | 358 | 11878400 | ||
215668025 | duythien2212 | G | July 26, 2023, 3:22 a.m. | OK | GNU C++17 | TESTS | 22 | 358 | 15769600 | ||
215624153 | komite | G | July 25, 2023, 5:06 p.m. | OK | GNU C++17 | TESTS | 22 | 373 | 9625600 | ||
215632986 | Coder_Nayak | G | July 25, 2023, 6:07 p.m. | OK | GNU C++17 | TESTS | 22 | 373 | 10342400 | ||
215661628 | wizwilzo | G | July 26, 2023, 2:05 a.m. | OK | GNU C++17 | TESTS | 22 | 373 | 14745600 | ||
215651581 | ssk4988 | G | July 25, 2023, 10:24 p.m. | OK | GNU C++17 | TESTS | 22 | 373 | 14950400 | ||
215630357 | QuangBuiCP | G | July 25, 2023, 5:45 p.m. | OK | GNU C++17 | TESTS | 22 | 374 | 7270400 | ||
215625223 | stop | G | July 25, 2023, 5:12 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 248 | 8089600 | ||
215640212 | lunchbox | G | July 25, 2023, 7:21 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 6041600 | ||
215637095 | udon1206 | G | July 25, 2023, 6:45 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 11468800 | ||
215665570 | counter | G | July 26, 2023, 2:54 a.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 12492800 | ||
215641435 | Glw_pls | G | July 25, 2023, 7:35 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 17612800 | ||
215636049 | neal | G | July 25, 2023, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 25600000 | ||
215635480 | neal | G | July 25, 2023, 6:28 p.m. | OK | GNU C++17 (64) | TESTS | 22 | 249 | 25600000 | ||
215668659 | ShirosakiMieru | G | July 26, 2023, 3:30 a.m. | OK | GNU C++17 (64) | TESTS | 22 | 264 | 11264000 | ||
215675240 | alif_cse_ju | G | July 26, 2023, 4:57 a.m. | OK | GNU C++17 (64) | TESTS | 22 | 264 | 12492800 | ||
215662885 | Once_I_Liked_AGirl | G | July 26, 2023, 2:22 a.m. | OK | GNU C++17 (64) | TESTS | 22 | 264 | 17612800 | ||
215639668 | Alekseyka20x | G | July 25, 2023, 7:15 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 108 | 22732800 | ||
215640009 | Alekseyka20x | G | July 25, 2023, 7:19 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 124 | 22732800 | ||
215640053 | Alekseyka20x | G | July 25, 2023, 7:19 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 124 | 22732800 | ||
215644025 | Alekseyka20x | G | July 25, 2023, 8:16 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 124 | 22937600 | ||
215646633 | Alekseyka20x | G | July 25, 2023, 8:52 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 124 | 22937600 | ||
215639271 | Alekseyka20x | G | July 25, 2023, 7:11 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 124 | 22937600 | ||
215646584 | Alekseyka20x | G | July 25, 2023, 8:51 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 139 | 16588800 | ||
215646168 | Alekseyka20x | G | July 25, 2023, 8:45 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 139 | 17510400 | ||
215646676 | Alekseyka20x | G | July 25, 2023, 8:53 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 139 | 31334400 | ||
215645591 | Alekseyka20x | G | July 25, 2023, 8:37 p.m. | OK | GNU C++20 (64) | TESTS | 22 | 139 | 50073600 | ||
215643237 | dzhi | G | July 25, 2023, 8:06 p.m. | OK | Java 11 | TESTS | 22 | 966 | 54681600 | ||
215675573 | theSSS | G | July 26, 2023, 5:02 a.m. | OK | Java 11 | TESTS | 22 | 1060 | 67481600 | ||
215672910 | theSSS | G | July 26, 2023, 4:26 a.m. | OK | Java 11 | TESTS | 22 | 1091 | 67481600 | ||
215627035 | merlin_ | G | July 25, 2023, 5:22 p.m. | OK | Java 17 | TESTS | 22 | 888 | 27136000 | ||
215658158 | wizardleen | G | July 26, 2023, 1:15 a.m. | OK | Java 17 | TESTS | 22 | 1013 | 69734400 | ||
215624444 | Ahmed_Hosssam | G | July 25, 2023, 5:08 p.m. | OK | Java 8 | TESTS | 22 | 607 | 16793600 | ||
215634141 | chinesedfan | G | July 25, 2023, 6:17 p.m. | OK | Node.js | TESTS | 22 | 1357 | 49049600 | ||
215645235 | SoleProprietor | G | July 25, 2023, 8:32 p.m. | OK | PyPy 3-64 | TESTS | 22 | 717 | 60518400 | ||
215644726 | SoleProprietor | G | July 25, 2023, 8:25 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1294 | 84070400 | ||
215625289 | Little_Sheep_Yawn | G | July 25, 2023, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1341 | 97689600 | ||
215655036 | liupengsay | G | July 26, 2023, 12:04 a.m. | OK | PyPy 3-64 | TESTS | 22 | 1419 | 76185600 | ||
215633262 | sushmanth.dampur8780 | G | July 25, 2023, 6:09 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1513 | 98304000 | ||
215643602 | SoleProprietor | G | July 25, 2023, 8:11 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1543 | 99123200 | ||
215632943 | titia | G | July 25, 2023, 6:06 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1731 | 106905600 | ||
215620911 | kamilszymczak1 | G | July 25, 2023, 4:53 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1887 | 89395200 | ||
215654305 | RobinFromTheHood | G | July 25, 2023, 11:41 p.m. | OK | PyPy 3-64 | TESTS | 22 | 1949 | 102400000 | ||
215620223 | kamilszymczak1 | G | July 25, 2023, 4:52 p.m. | OK | PyPy 3-64 | TESTS | 22 | 2027 | 92876800 |
Back to search problems