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 |
---|---|---|---|---|---|---|
1910 | Kotlin Heroes: Episode 9 (Unrated, T-Shirts + Prizes!) | FINISHED | False | 9000 | 34874663 | Dec. 11, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 369 ) | D | Remove and Add | PROGRAMMING | *special greedy |
B"You are given an array a_1, a_2, ... , a_n , consisting of n integers. You goal is to make is strictly increasing. To achieve that, you perform each of the following operations exactly once: Note that you are not allowed to rearrange the elements of the array. For the resulting array a' , a'_1 < a'_2 < ... < a'_{n-1} should hold. Determine if it's possible to achieve that. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of elements of the array. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ). The sum of n over all testcases doesn't exceed 2 cdot 10^5 . For each testcase, print YES if it's possible to remove one element and add 1 to some elements (possibly, none or all), so that the array becomes strictly increasing. Otherwise, print NO. In the first testcase, you can remove the third element and add 1 to the second and the last element. a' will become [4, 5, 6] , which is strictly increasing. In the second testcase, there is no way to perform the operations, so that the result is strictly increasing. In the third testcase, you can remove either of the elements. In the fourth testcase, you are already given a strictly increasing array, but you still have to remove an element. The result a' can be [1, 3] , for example. "... |
123261 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
236801909 | cftauros | D | Dec. 11, 2023, 3:38 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 327 | 39628800 | ||
236797220 | Hakiobo | D | Dec. 11, 2023, 3:09 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 342 | 8806400 | ||
236795970 | happy.potato | D | Dec. 11, 2023, 3:02 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 343 | 8294400 | ||
236799819 | MagentaCobra | D | Dec. 11, 2023, 3:24 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 436 | 39424000 | ||
236799974 | ostroumov | D | Dec. 11, 2023, 3:25 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 498 | 77516800 | ||
236806757 | plastical | D | Dec. 11, 2023, 4:12 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 499 | 31334400 | ||
236795185 | pashka | D | Dec. 11, 2023, 2:58 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 499 | 57856000 | ||
236812635 | s-lissov | D | Dec. 11, 2023, 4:57 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 499 | 61747200 | ||
236804101 | BucketPotato | D | Dec. 11, 2023, 3:53 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 545 | 69427200 | ||
236796620 | linxiaotian | D | Dec. 11, 2023, 3:06 p.m. | OK | Kotlin 1.7 | TESTS | 23 | 545 | 88166400 | ||
236797881 | Spheniscine | D | Dec. 11, 2023, 3:13 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 451 | 79974400 | ||
236798660 | lightseba | D | Dec. 11, 2023, 3:18 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 514 | 37785600 | ||
236798470 | jvmusin | D | Dec. 11, 2023, 3:16 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 514 | 60928000 | ||
236800454 | dyukha | D | Dec. 11, 2023, 3:28 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 530 | 64614400 | ||
236798078 | koboshi | D | Dec. 11, 2023, 3:14 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 576 | 112128000 | ||
236805325 | Giga_Cronos | D | Dec. 11, 2023, 4:02 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 577 | 67276800 | ||
236797345 | joylintp | D | Dec. 11, 2023, 3:10 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 592 | 42086400 | ||
236801585 | Evocation | D | Dec. 11, 2023, 3:36 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 592 | 93388800 | ||
236812685 | cs142857 | D | Dec. 11, 2023, 4:58 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 608 | 39014400 | ||
236797524 | dranjohn | D | Dec. 11, 2023, 3:11 p.m. | OK | Kotlin 1.9 | TESTS | 23 | 624 | 121651200 |
Back to search problems