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.
Problems
B"You are given an array a of length n , consisting of positive integers. You can perform the following operation on this array any number of times (possibly zero): Note that you can choose any integer as x , it doesn't have to be positive. You have to calculate the minimum number of operations to make the array a sorted in strictly ascending order (i. xe2 x80 x89e. the condition a_1 < a_2 < ... < a_n must be satisfied). The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ) -- the array a . Additional constraint on the input: the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print one integer -- the minimum number of operations required to make a sorted in strictly ascending order. In the first test case, we can perform the operations as follows: In the second test case, we can perform one operation as follows: In the third test case, the array a is already sorted. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
221398899 |
Aria_Math |
D |
Sept. 1, 2023, 3:27 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
15 |
3481600 |
|
|
221395097 |
tokitsukaze |
D |
Sept. 1, 2023, 2:16 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
30 |
2560000 |
|
|
221394443 |
taozhiming |
D |
Sept. 1, 2023, 2:02 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
46 |
2457600 |
|
|
221392615 |
trh0630 |
D |
Sept. 1, 2023, 1:19 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
46 |
2457600 |
|
|
221351216 |
nhanhoang510 |
D |
Aug. 31, 2023, 4:28 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
61 |
2457600 |
|
|
221350731 |
Quartz_y |
D |
Aug. 31, 2023, 4:27 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
61 |
2457600 |
|
|
221397847 |
snail29565613 |
D |
Sept. 1, 2023, 3:10 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
62 |
2355200 |
|
|
221392448 |
onlycre |
D |
Sept. 1, 2023, 1:16 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
62 |
2355200 |
|
|
221372464 |
m3tr0 |
D |
Aug. 31, 2023, 6:41 p.m. |
OK |
GNU C++14 |
TESTS |
16 |
62 |
2355200 |
|
|
221397485 |
xzwys |
D |
Sept. 1, 2023, 3:03 a.m. |
OK |
GNU C++14 |
TESTS |
16 |
62 |
2457600 |
|
|
221372183 |
Mkswll |
D |
Aug. 31, 2023, 6:39 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
46 |
3174400 |
|
|
221403113 |
jican000 |
D |
Sept. 1, 2023, 4:43 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
819200 |
|
|
221395065 |
archiver |
D |
Sept. 1, 2023, 2:15 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
819200 |
|
|
221395670 |
dadaxigua |
D |
Sept. 1, 2023, 2:27 a.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
1638400 |
|
|
221383334 |
Knightshade |
D |
Aug. 31, 2023, 9:19 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
1638400 |
|
|
221359123 |
unbengable |
D |
Aug. 31, 2023, 4:51 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
1638400 |
|
|
221373880 |
AndrewSeven |
D |
Aug. 31, 2023, 6:57 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
2457600 |
|
|
221376004 |
Ismail_Alrifai |
D |
Aug. 31, 2023, 7:23 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
2560000 |
|
|
221361693 |
ST_ring |
D |
Aug. 31, 2023, 5:07 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
3174400 |
|
|
221353285 |
Doncho_Bonboncho |
D |
Aug. 31, 2023, 4:32 p.m. |
OK |
GNU C++17 |
TESTS |
16 |
61 |
11980800 |
|
|
221363872 |
Remilia1023 |
D |
Aug. 31, 2023, 5:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
31 |
4096000 |
|
|
221399070 |
Once_I_Liked_AGirl |
D |
Sept. 1, 2023, 3:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2457600 |
|
|
221384712 |
monkey8 |
D |
Aug. 31, 2023, 9:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2457600 |
|
|
221383263 |
gabriel88766 |
D |
Aug. 31, 2023, 9:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2457600 |
|
|
221380350 |
enslaved |
D |
Aug. 31, 2023, 8:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2457600 |
|
|
221360658 |
CurryWOE |
D |
Aug. 31, 2023, 5 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2457600 |
|
|
221354979 |
Fighoh |
D |
Aug. 31, 2023, 4:34 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2662400 |
|
|
221351095 |
Fighoh |
D |
Aug. 31, 2023, 4:28 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
2662400 |
|
|
221406912 |
nanoblob |
D |
Sept. 1, 2023, 5:50 a.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
3174400 |
|
|
221380631 |
AdityaDargan |
D |
Aug. 31, 2023, 8:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
16 |
46 |
3174400 |
|
|
221363360 |
nekoyukino |
D |
Aug. 31, 2023, 5:18 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
15 |
4505600 |
|
|
221389757 |
cmk666 |
D |
Sept. 1, 2023, 12:09 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
30 |
2867200 |
|
|
221394598 |
Robbe |
D |
Sept. 1, 2023, 2:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
819200 |
|
|
221370186 |
AnasMaged |
D |
Aug. 31, 2023, 6:18 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
819200 |
|
|
221366316 |
1RONMAN |
D |
Aug. 31, 2023, 5:42 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
819200 |
|
|
221364561 |
jainmilind |
D |
Aug. 31, 2023, 5:28 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
819200 |
|
|
221375436 |
ahmad_alghadban |
D |
Aug. 31, 2023, 7:16 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
1638400 |
|
|
221362378 |
HyeuShogun |
D |
Aug. 31, 2023, 5:11 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
1638400 |
|
|
221361093 |
senR |
D |
Aug. 31, 2023, 5:03 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
1638400 |
|
|
221360880 |
Pa_sha |
D |
Aug. 31, 2023, 5:01 p.m. |
OK |
GNU C++20 (64) |
TESTS |
16 |
31 |
1638400 |
|
|
221351713 |
O_Vladimir |
D |
Aug. 31, 2023, 4:29 p.m. |
OK |
Go |
TESTS |
16 |
124 |
8704000 |
|
|
221385235 |
themadknight45 |
D |
Aug. 31, 2023, 10 p.m. |
OK |
Java 11 |
TESTS |
16 |
218 |
0 |
|
|
221378373 |
vijaypanwar_12 |
D |
Aug. 31, 2023, 7:55 p.m. |
OK |
Java 11 |
TESTS |
16 |
234 |
0 |
|
|
221359890 |
bobib |
D |
Aug. 31, 2023, 4:55 p.m. |
OK |
Java 11 |
TESTS |
16 |
264 |
0 |
|
|
221379199 |
kasiru_69 |
D |
Aug. 31, 2023, 8:08 p.m. |
OK |
Java 11 |
TESTS |
16 |
327 |
0 |
|
|
221355102 |
radianite2003 |
D |
Aug. 31, 2023, 4:34 p.m. |
OK |
Java 11 |
TESTS |
16 |
343 |
20684800 |
|
|
221354379 |
verma.shivam2605 |
D |
Aug. 31, 2023, 4:33 p.m. |
OK |
Java 11 |
TESTS |
16 |
576 |
18636800 |
|
|
221355441 |
Sincerely_yours |
D |
Aug. 31, 2023, 4:34 p.m. |
OK |
Java 11 |
TESTS |
16 |
639 |
18636800 |
|
|
221354727 |
darpan_12 |
D |
Aug. 31, 2023, 4:33 p.m. |
OK |
Java 11 |
TESTS |
16 |
639 |
18636800 |
|
|
221379655 |
_ryan18_ |
D |
Aug. 31, 2023, 8:14 p.m. |
OK |
Java 17 |
TESTS |
16 |
264 |
409600 |
|
|
221362875 |
dzhi |
D |
Aug. 31, 2023, 5:15 p.m. |
OK |
Java 17 |
TESTS |
16 |
295 |
1228800 |
|
|
221364815 |
TrueBat |
D |
Aug. 31, 2023, 5:30 p.m. |
OK |
Java 17 |
TESTS |
16 |
576 |
819200 |
|
|
221351543 |
Utk__03 |
D |
Aug. 31, 2023, 4:29 p.m. |
OK |
Java 17 |
TESTS |
16 |
623 |
28262400 |
|
|
221351038 |
CodingCoderCode |
D |
Aug. 31, 2023, 4:28 p.m. |
OK |
Java 17 |
TESTS |
16 |
639 |
28057600 |
|
|
221378389 |
vijay_panwar12 |
D |
Aug. 31, 2023, 7:55 p.m. |
OK |
Java 8 |
TESTS |
16 |
140 |
2867200 |
|
|
221391537 |
NerfThis |
D |
Sept. 1, 2023, 12:54 a.m. |
OK |
Java 8 |
TESTS |
16 |
155 |
2867200 |
|
|
221362720 |
priyaroy3370 |
D |
Aug. 31, 2023, 5:14 p.m. |
OK |
Java 8 |
TESTS |
16 |
155 |
5120000 |
|
|
221359434 |
vatsal_04 |
D |
Aug. 31, 2023, 4:52 p.m. |
OK |
Java 8 |
TESTS |
16 |
156 |
2764800 |
|
|
221370082 |
Mo-Ehab |
D |
Aug. 31, 2023, 6:17 p.m. |
OK |
Node.js |
TESTS |
16 |
171 |
33280000 |
|
|
221363757 |
conqueror_of_womais |
D |
Aug. 31, 2023, 5:21 p.m. |
OK |
PyPy 3 |
TESTS |
16 |
342 |
19456000 |
|
|
221397438 |
RobinFromTheHood |
D |
Sept. 1, 2023, 3:02 a.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
24883200 |
|
|
221356525 |
2025 |
D |
Aug. 31, 2023, 4:38 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
25907200 |
|
|
221357633 |
alsrjs0725 |
D |
Aug. 31, 2023, 4:43 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
26009600 |
|
|
221375673 |
RobinFromTheHood |
D |
Aug. 31, 2023, 7:19 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
171 |
26726400 |
|
|
221379892 |
hvbird |
D |
Aug. 31, 2023, 8:18 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
186 |
28876800 |
|
|
221362759 |
ossau_guildo |
D |
Aug. 31, 2023, 5:14 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
186 |
29491200 |
|
|
221403725 |
flexr |
D |
Sept. 1, 2023, 4:53 a.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
187 |
20172800 |
|
|
221388634 |
gardengnome |
D |
Aug. 31, 2023, 11:35 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
187 |
26112000 |
|
|
221388493 |
gardengnome |
D |
Aug. 31, 2023, 11:31 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
187 |
26112000 |
|
|
221367678 |
sushmanth.dampur8780 |
D |
Aug. 31, 2023, 5:55 p.m. |
OK |
PyPy 3-64 |
TESTS |
16 |
187 |
29081600 |
|
|
221369387 |
alexpods |
D |
Aug. 31, 2023, 6:11 p.m. |
OK |
Python 3 |
TESTS |
16 |
234 |
36556800 |
|
|
221370620 |
alexpods |
D |
Aug. 31, 2023, 6:23 p.m. |
OK |
Python 3 |
TESTS |
16 |
249 |
36454400 |
|
|
221356619 |
AyuAnchor |
D |
Aug. 31, 2023, 4:38 p.m. |
OK |
Python 3 |
TESTS |
16 |
264 |
26828800 |
|
|
221370503 |
alexpods |
D |
Aug. 31, 2023, 6:22 p.m. |
OK |
Python 3 |
TESTS |
16 |
295 |
36454400 |
|
|
221370426 |
alexpods |
D |
Aug. 31, 2023, 6:21 p.m. |
OK |
Python 3 |
TESTS |
16 |
295 |
36454400 |
|
|
221370579 |
alexpods |
D |
Aug. 31, 2023, 6:22 p.m. |
OK |
Python 3 |
TESTS |
16 |
296 |
36556800 |
|
|
221401127 |
janitw |
D |
Sept. 1, 2023, 4:09 a.m. |
OK |
Python 3 |
TESTS |
16 |
327 |
26828800 |
|
|
221391532 |
deekshithaachanta99 |
D |
Sept. 1, 2023, 12:54 a.m. |
OK |
Python 3 |
TESTS |
16 |
342 |
28057600 |
|
|
221351073 |
hayatroid |
D |
Aug. 31, 2023, 4:28 p.m. |
OK |
Python 3 |
TESTS |
16 |
404 |
26828800 |
|
|
221357373 |
jzz2.0 |
D |
Aug. 31, 2023, 4:41 p.m. |
OK |
Python 3 |
TESTS |
16 |
405 |
30208000 |
|
|
221361486 |
haihamabossu |
D |
Aug. 31, 2023, 5:05 p.m. |
OK |
Rust 2021 |
TESTS |
16 |
93 |
38604800 |
|
|
221363819 |
MenezesDM |
D |
Aug. 31, 2023, 5:22 p.m. |
OK |
Rust 2021 |
TESTS |
16 |
187 |
36249600 |
|
|
remove filters
Back to search problems