Codeforces Round 1037 (Div. 3)

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
2126 Codeforces Round 1037 (Div. 3) FINISHED False 8100 23642723 July 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 26162 ) C I Will Definitely Make It PROGRAMMING greedy sortings

You are given (n) towers, numbered from (1) to (n). Tower (i) has a height of (h_i). At time (0), you are on the tower with index (k), and the current water level is (1). Every second, the water level rises by (1) unit. At any moment, if the water level becomes strictly greater than the height of the tower you are on, you perish. You have a magical ability: at moment (x), you can start teleporting from tower (i) to tower (j), which will take (\lvert h_i - h_j \rvert) seconds. That is, until moment (x + \lvert h_i - h_j \rvert), you will be on tower (i), and at moment (x + \lvert h_i - h_j \rvert), you will move to tower (j). You can start a new teleportation at the same moment you just arrived at tower (j). For example, if (n=k=4), (h=4, 4, 4, 2), then if you start teleporting from tower (4) to tower (1) at moment (0), the movement will look as follows: Note that if the height of tower (1) were (5), you would not be able to teleport to it immediately, as you would be submerged at moment (2). Your goal is to reach any tower with the maximum height before the water covers you. Determine if this is possible. Each test consists of several test cases. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((1 \le k \le n \le 10^5)) — the number of towers and the index of the tower you are initially on. The second line contains (n) integers (h_1, h_2, \dots, h_n) ((1 \le h_i \le 10^9)) — the heights of the towers. It is guaranteed that the sum of all (n) across all test cases does not exceed (10^5). For each test case, output one line: " YES ", if you can reach the tower with the maximum height before the water covers you, or " NO " otherwise. You may output each letter in

Tutorials

144845

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
329572856 guchen. C July 18, 2025, 3:39 a.m. OK C++17 (GCC 7-32) TESTS 6 46 0
329545504 botas14 C July 17, 2025, 8:01 p.m. OK C++17 (GCC 7-32) TESTS 6 61 0
329528732 SarthakGund C July 17, 2025, 5:29 p.m. OK C++17 (GCC 7-32) TESTS 6 61 0
329580994 vandykasuryadi C July 18, 2025, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 6 61 0
329575946 vo1dpro C July 18, 2025, 4:18 a.m. OK C++17 (GCC 7-32) TESTS 6 61 0
329555944 andyleach C July 17, 2025, 11:40 p.m. OK C++17 (GCC 7-32) TESTS 6 61 0
329557244 SF-Manman C July 18, 2025, 12:24 a.m. OK C++17 (GCC 7-32) TESTS 6 61 102400
329581315 yuanmouren C July 18, 2025, 5:22 a.m. OK C++17 (GCC 7-32) TESTS 6 61 102400
329559107 kolpkolp C July 18, 2025, 1:05 a.m. OK C++17 (GCC 7-32) TESTS 6 61 32153600
329585288 IntPetro C July 18, 2025, 6:02 a.m. OK C++17 (GCC 7-32) TESTS 6 62 0
329526025 svinoxx C July 17, 2025, 5:13 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
329531749 Hawkstar C July 17, 2025, 5:50 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
329531671 f20230377 C July 17, 2025, 5:49 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
329538573 fzzz03 C July 17, 2025, 6:47 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
329538544 fizaaaaaaaa C July 17, 2025, 6:46 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
329546798 tonytroeff C July 17, 2025, 8:18 p.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
329569788 rrrrrrrrose C July 18, 2025, 3:09 a.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
329560675 AkaiLemon C July 18, 2025, 1:32 a.m. OK C++20 (GCC 13-64) TESTS 6 46 819200
329584702 mssaketsaii45 C July 18, 2025, 5:57 a.m. OK C++20 (GCC 13-64) TESTS 6 61 0
329585344 devan_modhavadiya C July 18, 2025, 6:02 a.m. OK C++20 (GCC 13-64) TESTS 6 61 0
329561251 defaultpather C July 18, 2025, 1:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 0
329525287 Lechaa C July 17, 2025, 5:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 0
329579496 abrarxawad C July 18, 2025, 5:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 0
329576058 Tenryon C July 18, 2025, 4:19 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 0
329528430 Ravindra_Rinwa C July 17, 2025, 5:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 46 102400
329576942 n00b_koder C July 18, 2025, 4:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
329577771 Om_patel123 C July 18, 2025, 4:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
329577190 sharodh25 C July 18, 2025, 4:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
329583654 6tnvgkn24 C July 18, 2025, 5:46 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
329578892 S_R_Arnab C July 18, 2025, 4:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 61 0
329549447 legacy45 C July 17, 2025, 8:57 p.m. OK GNU C11 TESTS 6 61 409600
329536002 yasigma C July 17, 2025, 6:24 p.m. OK GNU C11 TESTS 6 77 409600
329537609 yasigma C July 17, 2025, 6:37 p.m. OK GNU C11 TESTS 6 92 409600
329532435 __blank__171 C July 17, 2025, 5:55 p.m. OK GNU C11 TESTS 6 92 512000
329532079 __blank__171 C July 17, 2025, 5:52 p.m. OK GNU C11 TESTS 6 93 409600
329555646 shashi18 C July 17, 2025, 11:30 p.m. OK GNU C11 TESTS 6 93 512000
329577681 wanglinqi C July 18, 2025, 4:40 a.m. OK GNU C11 TESTS 6 93 512000
329569491 AlphaOrionis69 C July 18, 2025, 3:06 a.m. OK GNU C11 TESTS 6 93 10854400
329540450 sujalsharma_13 C July 17, 2025, 7:05 p.m. OK Java 21 TESTS 6 233 716800
329547360 echogenesis C July 17, 2025, 8:27 p.m. OK Java 21 TESTS 6 249 921600
329545376 Abominable C July 17, 2025, 7:59 p.m. OK Java 21 TESTS 6 265 614400
329585360 riteshy1802 C July 18, 2025, 6:02 a.m. OK Java 21 TESTS 6 265 1024000
329544969 Abominable C July 17, 2025, 7:54 p.m. OK Java 21 TESTS 6 280 614400
329549917 officialarpit.4k C July 17, 2025, 9:05 p.m. OK Java 21 TESTS 6 280 1740800
329576294 shiva___np C July 18, 2025, 4:23 a.m. OK Java 21 TESTS 6 281 307200
329534730 alwaysreddysudeep C July 17, 2025, 6:13 p.m. OK Java 21 TESTS 6 281 409600
329540202 sujalsharma_13 C July 17, 2025, 7:03 p.m. OK Java 21 TESTS 6 281 614400
329527033 fatal-98 C July 17, 2025, 5:19 p.m. OK Java 21 TESTS 6 281 716800
329533928 Trouble_shooter C July 17, 2025, 6:06 p.m. OK Java 8 TESTS 6 156 0
329530402 akki_code C July 17, 2025, 5:41 p.m. OK Java 8 TESTS 6 171 0
329552745 tigerguy09 C July 17, 2025, 10:08 p.m. OK Java 8 TESTS 6 281 0
329541314 feynmanscat005 C July 17, 2025, 7:14 p.m. OK Java 8 TESTS 6 312 0
329530975 SmoothOperator99 C July 17, 2025, 5:45 p.m. OK Java 8 TESTS 6 327 0
329557437 warframe C July 18, 2025, 12:30 a.m. OK Java 8 TESTS 6 343 0
329573614 divyanshvijay079 C July 18, 2025, 3:48 a.m. OK Java 8 TESTS 6 374 0
329578640 uju C July 18, 2025, 4:51 a.m. OK Java 8 TESTS 6 421 3891200
329541967 Mandeep234 C July 17, 2025, 7:21 p.m. OK PyPy 3 TESTS 6 342 10649600
329533346 naman.iitd28 C July 17, 2025, 6:02 p.m. OK PyPy 3 TESTS 6 359 11468800
329546843 v1kCoder C July 17, 2025, 8:19 p.m. OK PyPy 3 TESTS 6 390 10649600
329551400 lazy_raihan C July 17, 2025, 9:32 p.m. OK PyPy 3 TESTS 6 452 13312000
329538972 khouilldi_khalil C July 17, 2025, 6:50 p.m. OK PyPy 3 TESTS 6 593 15462400
329573008 Emikooh C July 18, 2025, 3:41 a.m. OK PyPy 3-64 TESTS 6 124 13209600
329562803 date727 C July 18, 2025, 2:03 a.m. OK PyPy 3-64 TESTS 6 124 13209600
329552297 PeCoP C July 17, 2025, 9:56 p.m. OK PyPy 3-64 TESTS 6 124 18636800
329558369 fatalerror C July 18, 2025, 12:51 a.m. OK PyPy 3-64 TESTS 6 125 13516800
329582068 alexwice C July 18, 2025, 5:30 a.m. OK PyPy 3-64 TESTS 6 140 15155200
329539835 iamcvarma C July 17, 2025, 6:59 p.m. OK PyPy 3-64 TESTS 6 140 18227200
329530170 MBora C July 17, 2025, 5:39 p.m. OK PyPy 3-64 TESTS 6 155 13312000
329542860 VSS102484_farazUsman C July 17, 2025, 7:30 p.m. OK PyPy 3-64 TESTS 6 155 17203200
329580001 Amarnath0038 C July 18, 2025, 5:07 a.m. OK PyPy 3-64 TESTS 6 156 13209600
329551481 Alex239 C July 17, 2025, 9:34 p.m. OK PyPy 3-64 TESTS 6 171 12083200
329572095 DillibabuR C July 18, 2025, 3:30 a.m. OK Python 3 TESTS 6 124 12390400
329564054 five-pieced_ShangYang C July 18, 2025, 2:17 a.m. OK Python 3 TESTS 6 124 12390400
329565968 five-pieced_ShangYang C July 18, 2025, 2:35 a.m. OK Python 3 TESTS 6 124 12492800
329553520 maan.dhruv C July 17, 2025, 10:29 p.m. OK Python 3 TESTS 6 124 13721600
329579185 BEAST-56 C July 18, 2025, 4:58 a.m. OK Python 3 TESTS 6 125 12390400
329535008 vafly C July 17, 2025, 6:16 p.m. OK Python 3 TESTS 6 125 12697600
329557720 coder.sy C July 18, 2025, 12:38 a.m. OK Python 3 TESTS 6 139 12390400
329532548 Eshan19 C July 17, 2025, 5:56 p.m. OK Python 3 TESTS 6 139 13619200
329566153 five-pieced_ShangYang C July 18, 2025, 2:37 a.m. OK Python 3 TESTS 6 140 12390400
329546725 Ninja0108 C July 17, 2025, 8:17 p.m. OK Python 3 TESTS 6 140 12390400
329554691 JakeMate14 C July 17, 2025, 11:01 p.m. OK Rust 2021 TESTS 6 62 0

remove filters

Back to search problems