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 |
|---|---|---|---|---|---|---|
| 2071 | Codeforces Round 1007 (Div. 2) | FINISHED | False | 8100 | 35652323 | Feb. 28, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 326 ) | F | Towering Arrays | PROGRAMMING | binary search data structures |
An array (b = b_1, b_2, \ldots, b_m) of length (m) is called (p)- towering if there exists an index (i) ((1\le i\le m)) such that for every index (j) ((1 \le j \le m)), the following condition holds: ()b_j \ge p - |i - j|.() Given an array (a = a_1, a_2, \ldots, a_n) of length (n), you can remove at most (k) elements from it. Determine the maximum value of (p) for which the remaining array can be made (p)- towering . Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (k) ((0 \le k < n \le 2 \cdot 10^5)). The second line contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)). It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer — the maximum value of (p) for which the remaining array can be made (p)- towering . In the first test case, you cannot delete any element. The array remains (2, 1, 4, \color{red}{5}, 2) and is p-towering for (p = 3) by picking (i = 4): (a_1 = 2 \ge p - |i - 1| = 3 - |4 - 1| = 0); (a_2 = 1 \ge p - |i - 2| = 3 - |4 - 2| = 1); (a_3 = 4 \ge p - |i - 3| = 3 - |4 - 3| = 2); (a_4 = 5 \ge p - |i - 4| = 3 - |4 - 4| = 3); (a_5 = 2 \ge p - |i - 5| = 3 - |4 - 5| = 2). In the second test case, you can remove the first, second, and fifth elements to obtain the array (4, \color{red}{5}). Clearly, the obtained array is p-towering for (p = 5) by picking (i = 2). |
| Codeforces Round 1007 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 308430152 | anirudh1317 | F | March 1, 2025, 2:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 702 | 10444800 | ||
| 308394305 | ay1357 | F | Feb. 28, 2025, 6:13 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 1171 | 102400 | ||
| 308393647 | ay1357 | F | Feb. 28, 2025, 6:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 1171 | 102400 | ||
| 308389354 | gentleman.1 | F | Feb. 28, 2025, 5:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 46 | 1203 | 0 | ||
| 308419617 | liympanda | F | Feb. 28, 2025, 10:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 2234 | 7680000 | ||
| 308426365 | nishkarsh | F | March 1, 2025, 1:03 a.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 4374 | 10240000 | ||
| 308381815 | potato167 | F | Feb. 28, 2025, 4:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 46 | 4531 | 2150400 | ||
| 308380393 | Um_nik | F | Feb. 28, 2025, 4:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 46 | 4781 | 20889600 | ||
| 308377404 | LifeWillChange | F | Feb. 28, 2025, 4:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 46 | 4984 | 12697600 | ||
| 308415522 | Az3ar | F | Feb. 28, 2025, 9:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 5468 | 8908800 | ||
| 308419194 | kaiboy | F | Feb. 28, 2025, 10:26 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 515 | 11264000 | ||
| 308419350 | kaiboy | F | Feb. 28, 2025, 10:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 561 | 10444800 | ||
| 308387969 | ruhittanvir14 | F | Feb. 28, 2025, 5:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 46 | 1265 | 102400 | ||
| 308395037 | -Shu- | F | Feb. 28, 2025, 6:18 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 4671 | 28467200 | ||
| 308394076 | Tier_3_failure | F | Feb. 28, 2025, 6:11 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 5608 | 8806400 | ||
| 308380088 | Lev_dimchenko_autist | F | Feb. 28, 2025, 4:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 46 | 5858 | 3072000 | ||
| 308424443 | BernatP | F | March 1, 2025, 12:18 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 5937 | 9625600 | ||
| 308381510 | -Shu- | F | Feb. 28, 2025, 4:44 p.m. | OK | C++20 (GCC 13-64) | TESTS | 46 | 5999 | 18841600 | ||
| 308396531 | Tatva | F | Feb. 28, 2025, 6:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 874 | 10444800 | ||
| 308394329 | SUPHUB | F | Feb. 28, 2025, 6:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 984 | 102400 | ||
| 308380795 | 415411 | F | Feb. 28, 2025, 4:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 46 | 2108 | 11673600 | ||
| 308376946 | Nachia | F | Feb. 28, 2025, 4:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 46 | 2296 | 2560000 | ||
| 308378388 | smilences | F | Feb. 28, 2025, 4:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 46 | 2625 | 11468800 | ||
| 308392211 | amirhoseinfar1385 | F | Feb. 28, 2025, 5:57 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 3092 | 8806400 | ||
| 308419303 | Tamatem.1 | F | Feb. 28, 2025, 10:28 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 3530 | 8908800 | ||
| 308429332 | Benq | F | March 1, 2025, 2 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 3686 | 8908800 | ||
| 308395839 | 424479543 | F | Feb. 28, 2025, 6:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 3796 | 11468800 | ||
| 308374804 | ksun48 | F | Feb. 28, 2025, 4:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 46 | 3874 | 4403200 | ||
| 308417411 | SleepLessCoder.. | F | Feb. 28, 2025, 9:57 p.m. | OK | Java 21 | TESTS | 47 | 2702 | 1945600 |
Back to search problems