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 |
|---|---|---|---|---|---|---|
| 2081 | Codeforces Round 1010 (Div. 1, Unrated) | FINISHED | False | 10800 | 34356323 | March 15, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 991 ) | B | Balancing | PROGRAMMING | greedy |
Ecrade has an integer array (a_1, a_2, \ldots, a_n). It's guaranteed that for each (1 \le i < n), (a_i \neq a_{i+1}). Ecrade can perform several operations on the array to make it strictly increasing. In each operation, he can choose two integers (l) and (r) ((1 \le l \le r \le n)) and replace (a_l, a_{l+1}, \ldots, a_r) with any (r-l+1) integers (a'_l, a'_{l+1}, \ldots, a'_r) satisfying the following constraint: For each (l \le i < r), the comparison between (a'_i) and (a'_{i+1}) is the same as that between (a_i) and (a_{i+1}), i.e., if (a_i < a_{i + 1}), then (a'_i < a'_{i + 1}); otherwise, if (a_i > a_{i + 1}), then (a'_i > a'_{i + 1}); otherwise, if (a_i = a_{i + 1}), then (a'_i = a'_{i + 1}). Ecrade wants to know the minimum number of operations to make the array strictly increasing. However, it seems a little difficult, so please help him! 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 a single integer (n) ((2 \le n \le 2 \cdot 10^5)). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((-10^9 \le a_i \le 10^9)). It is guaranteed that for each (1 \le i< n), (a_i \neq a_{i+1}). It is guaranteed that the sum of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer representing the minimum number of operations to make the array strictly increasing. In the first test case, a possible way to obtain the minimum number of operations: In the first operation, choose (l = 2, r = 2) and (a'_2 = 4), then (a=3, 4, 1); In the second operation, choose (l = 1, r = 2) and (a'_1 = -1, a'_2 = 0), then (a=-1, 0, 1). In the second test case, a possible way to obtain the minimum number of operatio |
| Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 310811596 | wzc_IOI_czw | B | March 16, 2025, 12:49 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 93 | 819200 | ||
| 310748854 | Bossusuprem | B | March 15, 2025, 3:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 0 | ||
| 310798847 | B_3 | B | March 15, 2025, 9:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 102400 | ||
| 310737148 | Morphed | B | March 15, 2025, 2:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 819200 | ||
| 310797111 | B_3 | B | March 15, 2025, 8:55 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 5632000 | ||
| 310747859 | ender_shayan | B | March 15, 2025, 3:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 109 | 48128000 | ||
| 310749831 | MCPlayer542 | B | March 15, 2025, 3:31 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 124 | 0 | ||
| 310753663 | SkillIssueWAGuy | B | March 15, 2025, 3:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 124 | 102400 | ||
| 310813079 | pp_orange | B | March 16, 2025, 1:22 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 124 | 819200 | ||
| 310751104 | changle_knh | B | March 15, 2025, 3:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 124 | 819200 | ||
| 310787015 | cockatooo_2025GM | B | March 15, 2025, 7:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 77 | 102400 | ||
| 310826028 | MR_NoSolution | B | March 16, 2025, 3:27 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 78 | 102400 | ||
| 310809911 | GOTKAKO | B | March 16, 2025, 12:06 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 78 | 102400 | ||
| 310806244 | turkhuu622 | B | March 15, 2025, 10:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 78 | 102400 | ||
| 310793351 | hot-anime-girl | B | March 15, 2025, 8:15 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 78 | 819200 | ||
| 310836131 | Hojstyer | B | March 16, 2025, 5:44 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 92 | 0 | ||
| 310785349 | Benq | B | March 15, 2025, 7 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 92 | 102400 | ||
| 310764342 | RGB_ICPC1 | B | March 15, 2025, 4:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 92 | 819200 | ||
| 310778284 | potatoo | B | March 15, 2025, 6 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 93 | 0 | ||
| 310827560 | enslaved | B | March 16, 2025, 3:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 93 | 102400 | ||
| 310836353 | Ferrriccc | B | March 16, 2025, 5:46 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 77 | 102400 | ||
| 310785940 | YxqK | B | March 15, 2025, 7:05 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 77 | 102400 | ||
| 310835687 | YuukiS | B | March 16, 2025, 5:40 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 78 | 102400 | ||
| 310824056 | Srginit286 | B | March 16, 2025, 2:50 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 78 | 819200 | ||
| 310784118 | jatking | B | March 15, 2025, 6:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 78 | 819200 | ||
| 310777069 | gleb.astashkin | B | March 15, 2025, 5:52 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 92 | 0 | ||
| 310756764 | RNS_KSR | B | March 15, 2025, 3:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 93 | 0 | ||
| 310798905 | coldminded | B | March 15, 2025, 9:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 93 | 102400 | ||
| 310789832 | kevin | B | March 15, 2025, 7:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 93 | 102400 | ||
| 310751151 | Halzion | B | March 15, 2025, 3:35 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 93 | 102400 | ||
| 310776487 | hos.lyric | B | March 15, 2025, 5:47 p.m. | OK | D | TESTS | 18 | 140 | 10137600 | ||
| 310744615 | pengin_2000 | B | March 15, 2025, 3:15 p.m. | OK | GNU C11 | TESTS | 18 | 93 | 921600 | ||
| 310753389 | Z_actuary | B | March 15, 2025, 3:43 p.m. | OK | PyPy 3-64 | TESTS | 18 | 171 | 26931200 | ||
| 310821737 | bronze_coder | B | March 16, 2025, 2:06 a.m. | OK | PyPy 3-64 | TESTS | 18 | 234 | 23654400 |
Back to search problems