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'Mark is cleaning a row of n rooms. The i -th room has a nonnegative dust level a_i . He has a magical cleaning machine that can do the following three-step operation. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 2 <= q n <= q 2 cdot 10^5 ) -- the number of rooms. The second line of each test case contains n integers a_1 , a_2 , ..., a_n ( 0 <= q a_i <= q 10^9 ) -- the dust level of each room. It is guaranteed that the sum of n across all test cases does not exceed 2 cdot 10^5 . For each test case, print a line containing a single integer -- the minimum number of operations. It can be proven that there is a sequence of operations that meets the goal. In the first case, one possible sequence of operations is as follows. In the second case, one possible sequence of operations is as follows. In the last case, the array already satisfies the condition. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
164385861 |
chrisfcoder |
B |
July 16, 2022, 2:50 a.m. |
OK |
C# 10 |
TESTS |
14 |
124 |
26112000 |
|
|
164385778 |
chrisfcoder |
B |
July 16, 2022, 2:49 a.m. |
OK |
C# 10 |
TESTS |
14 |
124 |
26112000 |
|
|
164349427 |
ansergeyg |
B |
July 15, 2022, 5:10 p.m. |
OK |
C# 8 |
TESTS |
14 |
124 |
25702400 |
|
|
164376591 |
Yaropolk |
B |
July 16, 2022, 12:07 a.m. |
OK |
C# 8 |
TESTS |
14 |
139 |
25190400 |
|
|
164358466 |
naumov1024 |
B |
July 15, 2022, 6:38 p.m. |
OK |
C# 8 |
TESTS |
14 |
140 |
25190400 |
|
|
164377563 |
Pcjmy |
B |
July 16, 2022, 12:33 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
14 |
873 |
1843200 |
|
|
164377606 |
Pcjmy |
B |
July 16, 2022, 12:35 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
14 |
904 |
1843200 |
|
|
164386122 |
gxlois |
B |
July 16, 2022, 2:53 a.m. |
OK |
GNU C11 |
TESTS |
14 |
46 |
0 |
|
|
164344840 |
tonmoy00saha |
B |
July 15, 2022, 4:36 p.m. |
OK |
GNU C11 |
TESTS |
14 |
46 |
819200 |
|
|
164355628 |
Ayush_123_4 |
B |
July 15, 2022, 6:10 p.m. |
OK |
GNU C11 |
TESTS |
14 |
46 |
1638400 |
|
|
164389250 |
vjudge4 |
B |
July 16, 2022, 3:29 a.m. |
OK |
GNU C11 |
TESTS |
14 |
61 |
819200 |
|
|
164385057 |
Lushaojie |
B |
July 16, 2022, 2:40 a.m. |
OK |
GNU C11 |
TESTS |
14 |
61 |
819200 |
|
|
164363761 |
Divyansh10108 |
B |
July 15, 2022, 7:44 p.m. |
OK |
GNU C11 |
TESTS |
14 |
62 |
1638400 |
|
|
164349903 |
carmanman |
B |
July 15, 2022, 5:14 p.m. |
OK |
GNU C11 |
TESTS |
14 |
452 |
1638400 |
|
|
164343064 |
lemoncookie |
B |
July 15, 2022, 4:26 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
31 |
819200 |
|
|
164390444 |
cbdsopa |
B |
July 16, 2022, 3:43 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
31 |
1843200 |
|
|
164395173 |
fhhuo |
B |
July 16, 2022, 4:48 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
0 |
|
|
164344812 |
Linnins |
B |
July 15, 2022, 4:36 p.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
0 |
|
|
164390275 |
happyzzj |
B |
July 16, 2022, 3:40 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164389353 |
dr.stone_hack |
B |
July 16, 2022, 3:30 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164388296 |
luoZH111 |
B |
July 16, 2022, 3:18 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164383938 |
Kicamon |
B |
July 16, 2022, 2:24 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164380826 |
lzbzs |
B |
July 16, 2022, 1:37 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164394892 |
DemoAir |
B |
July 16, 2022, 4:44 a.m. |
OK |
GNU C++14 |
TESTS |
14 |
46 |
819200 |
|
|
164385111 |
Lushaojie |
B |
July 16, 2022, 2:41 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
31 |
819200 |
|
|
164387996 |
Lushaojie |
B |
July 16, 2022, 3:15 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164383141 |
Einstein1234 |
B |
July 16, 2022, 2:12 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164392851 |
Xerxes_2002 |
B |
July 16, 2022, 4:16 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164395867 |
_75_ |
B |
July 16, 2022, 4:58 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164396084 |
a_ban_don |
B |
July 16, 2022, 5 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164398011 |
OrazB |
B |
July 16, 2022, 5:22 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164401074 |
ggourav |
B |
July 16, 2022, 5:54 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164394957 |
nguyenphuc.khang110806 |
B |
July 16, 2022, 4:45 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164395051 |
Ivkosqn |
B |
July 16, 2022, 4:46 a.m. |
OK |
GNU C++17 |
TESTS |
14 |
46 |
819200 |
|
|
164390402 |
hdm0922 |
B |
July 16, 2022, 3:42 a.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
0 |
|
|
164390271 |
OTTFF |
B |
July 16, 2022, 3:40 a.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
819200 |
|
|
164376726 |
chenmoooo |
B |
July 16, 2022, 12:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
819200 |
|
|
164359530 |
tonkitude |
B |
July 15, 2022, 6:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
819200 |
|
|
164351928 |
xlz |
B |
July 15, 2022, 5:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
819200 |
|
|
164380474 |
Eter.nal |
B |
July 16, 2022, 1:31 a.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
1638400 |
|
|
164355317 |
MoNir_ |
B |
July 15, 2022, 6:07 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
1638400 |
|
|
164345689 |
Tkehsihba |
B |
July 15, 2022, 4:41 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
1638400 |
|
|
164342633 |
Golden |
B |
July 15, 2022, 4:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
1638400 |
|
|
164372764 |
ebarbs |
B |
July 15, 2022, 10:29 p.m. |
OK |
GNU C++17 (64) |
TESTS |
14 |
31 |
13926400 |
|
|
164359490 |
abooood.m |
B |
July 15, 2022, 6:50 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164349917 |
NoDrop |
B |
July 15, 2022, 5:15 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164348416 |
sike007 |
B |
July 15, 2022, 5:01 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164367630 |
ahemd123 |
B |
July 15, 2022, 8:43 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164369839 |
moghit_ad |
B |
July 15, 2022, 9:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164373911 |
ScorpioDagger |
B |
July 15, 2022, 10:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164375656 |
Ragab_Hakim |
B |
July 15, 2022, 11:37 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164378494 |
Nairy_a30 |
B |
July 16, 2022, 12:53 a.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164382266 |
CyberCow |
B |
July 16, 2022, 2 a.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164366043 |
czhang2718 |
B |
July 15, 2022, 8:17 p.m. |
OK |
GNU C++20 (64) |
TESTS |
14 |
31 |
0 |
|
|
164367514 |
pili |
B |
July 15, 2022, 8:41 p.m. |
OK |
Go |
TESTS |
14 |
46 |
5939200 |
|
|
164346849 |
tusher |
B |
July 15, 2022, 4:49 p.m. |
OK |
Go |
TESTS |
14 |
61 |
5939200 |
|
|
164342090 |
manchik |
B |
July 15, 2022, 4:22 p.m. |
OK |
Go |
TESTS |
14 |
140 |
4300800 |
|
|
164389844 |
satyaa_78 |
B |
July 16, 2022, 3:36 a.m. |
OK |
Java 11 |
TESTS |
14 |
171 |
0 |
|
|
164351858 |
deepaksach |
B |
July 15, 2022, 5:34 p.m. |
OK |
Java 11 |
TESTS |
14 |
171 |
0 |
|
|
164345338 |
coder0687 |
B |
July 15, 2022, 4:39 p.m. |
OK |
Java 11 |
TESTS |
14 |
171 |
0 |
|
|
164346163 |
TESTINGID |
B |
July 15, 2022, 4:44 p.m. |
OK |
Java 11 |
TESTS |
14 |
202 |
0 |
|
|
164344641 |
Etheric_Wanderer |
B |
July 15, 2022, 4:35 p.m. |
OK |
Java 11 |
TESTS |
14 |
202 |
3072000 |
|
|
164343823 |
parth_13_ |
B |
July 15, 2022, 4:30 p.m. |
OK |
Java 11 |
TESTS |
14 |
202 |
3072000 |
|
|
164357651 |
vijender_8601 |
B |
July 15, 2022, 6:30 p.m. |
OK |
Java 11 |
TESTS |
14 |
202 |
3174400 |
|
|
164373870 |
M-Yosef |
B |
July 15, 2022, 10:43 p.m. |
OK |
Java 11 |
TESTS |
14 |
202 |
3891200 |
|
|
164345980 |
TESTINGID |
B |
July 15, 2022, 4:43 p.m. |
OK |
Java 11 |
TESTS |
14 |
217 |
0 |
|
|
164386090 |
enviornment |
B |
July 16, 2022, 2:53 a.m. |
OK |
Java 11 |
TESTS |
14 |
218 |
2969600 |
|
|
164343966 |
Etheric_Wanderer |
B |
July 15, 2022, 4:31 p.m. |
OK |
Java 17 |
TESTS |
14 |
233 |
2867200 |
|
|
164344419 |
Etheric_Wanderer |
B |
July 15, 2022, 4:33 p.m. |
OK |
Java 17 |
TESTS |
14 |
233 |
3072000 |
|
|
164360231 |
Stirboy |
B |
July 15, 2022, 6:59 p.m. |
OK |
Java 17 |
TESTS |
14 |
280 |
3276800 |
|
|
164344567 |
Etheric_Wanderer |
B |
July 15, 2022, 4:34 p.m. |
OK |
Java 17 |
TESTS |
14 |
280 |
3788800 |
|
|
164367179 |
achandra03 |
B |
July 15, 2022, 8:35 p.m. |
OK |
Java 17 |
TESTS |
14 |
467 |
819200 |
|
|
164399801 |
cs_abdullah |
B |
July 16, 2022, 5:41 a.m. |
OK |
Java 17 |
TESTS |
14 |
498 |
819200 |
|
|
164400846 |
Manthan_Variya |
B |
July 16, 2022, 5:52 a.m. |
OK |
Java 17 |
TESTS |
14 |
514 |
409600 |
|
|
164360801 |
AdityaGupta19 |
B |
July 15, 2022, 7:06 p.m. |
OK |
Java 17 |
TESTS |
14 |
514 |
819200 |
|
|
164400196 |
cs_abdullah |
B |
July 16, 2022, 5:45 a.m. |
OK |
Java 17 |
TESTS |
14 |
530 |
819200 |
|
|
164370324 |
pashabezk |
B |
July 15, 2022, 9:33 p.m. |
OK |
Java 17 |
TESTS |
14 |
530 |
921600 |
|
|
164344998 |
LiuSheng |
B |
July 15, 2022, 4:37 p.m. |
OK |
Java 8 |
TESTS |
14 |
93 |
0 |
|
|
164394965 |
Darshan_Darji |
B |
July 16, 2022, 4:45 a.m. |
OK |
Java 8 |
TESTS |
14 |
108 |
0 |
|
|
164354665 |
BogoSortIsBest |
B |
July 15, 2022, 6:01 p.m. |
OK |
Java 8 |
TESTS |
14 |
139 |
9625600 |
|
|
164369501 |
malekelkassas |
B |
July 15, 2022, 9:16 p.m. |
OK |
Java 8 |
TESTS |
14 |
139 |
11366400 |
|
|
164388088 |
imded |
B |
July 16, 2022, 3:15 a.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11059200 |
|
|
164368776 |
handle007 |
B |
July 15, 2022, 9:02 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11059200 |
|
|
164345257 |
themadknight45 |
B |
July 15, 2022, 4:38 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11059200 |
|
|
164344108 |
Mohamed308 |
B |
July 15, 2022, 4:32 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11059200 |
|
|
164371348 |
tushar24 |
B |
July 15, 2022, 9:55 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11161600 |
|
|
164345248 |
DemoAir |
B |
July 15, 2022, 4:38 p.m. |
OK |
Java 8 |
TESTS |
14 |
140 |
11161600 |
|
|
164396501 |
macacod |
B |
July 16, 2022, 5:06 a.m. |
OK |
Kotlin 1.6 |
TESTS |
14 |
420 |
18022400 |
|
|
164389981 |
sunkaimiao |
B |
July 16, 2022, 3:37 a.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
171 |
0 |
|
|
164399704 |
hiro220214 |
B |
July 16, 2022, 5:40 a.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
171 |
819200 |
|
|
164387985 |
Killer_No.47 |
B |
July 16, 2022, 3:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
171 |
819200 |
|
|
164364727 |
MOHAMED_SHEHTA_HASSAN |
B |
July 15, 2022, 7:58 p.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
171 |
1638400 |
|
|
164378358 |
y_abobakr |
B |
July 16, 2022, 12:51 a.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
187 |
819200 |
|
|
164383248 |
adfadsfsff |
B |
July 16, 2022, 2:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
14 |
202 |
1638400 |
|
|
164363795 |
goeyj |
B |
July 15, 2022, 7:45 p.m. |
OK |
Node.js |
TESTS |
14 |
202 |
27033600 |
|
|
164344167 |
1_2_3_4_5_9 |
B |
July 15, 2022, 4:32 p.m. |
OK |
PyPy 2 |
TESTS |
14 |
124 |
20992000 |
|
|
164371941 |
zxcuser2 |
B |
July 15, 2022, 10:07 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
233 |
17715200 |
|
|
164386244 |
MohamedHamed123 |
B |
July 16, 2022, 2:54 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
264 |
19353600 |
|
|
164383924 |
otsuneko |
B |
July 16, 2022, 2:24 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
265 |
83046400 |
|
|
164346129 |
surstromming |
B |
July 15, 2022, 4:44 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
296 |
18022400 |
|
|
164349485 |
pushsin089 |
B |
July 15, 2022, 5:11 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
326 |
19251200 |
|
|
164392761 |
trojan1771 |
B |
July 16, 2022, 4:15 a.m. |
OK |
PyPy 3 |
TESTS |
14 |
358 |
18124800 |
|
|
164341674 |
Error-404-- |
B |
July 15, 2022, 4:21 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
358 |
18227200 |
|
|
164364517 |
DesignCodeForces |
B |
July 15, 2022, 7:55 p.m. |
OK |
PyPy 3 |
TESTS |
14 |
374 |
19558400 |
|
|
164376720 |
tassei903 |
B |
July 16, 2022, 12:12 a.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
93 |
26521600 |
|
|
164370574 |
hkwu6013 |
B |
July 15, 2022, 9:38 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
93 |
27545600 |
|
|
164399783 |
SubsTheTechnomancer |
B |
July 16, 2022, 5:41 a.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
109 |
29491200 |
|
|
164351203 |
Chahal_Sakshat |
B |
July 15, 2022, 5:27 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
124 |
23244800 |
|
|
164361536 |
DarkHorse_it_iz2.0 |
B |
July 15, 2022, 7:15 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
124 |
28774400 |
|
|
164345080 |
hk10537 |
B |
July 15, 2022, 4:37 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
124 |
28979200 |
|
|
164351023 |
biglunchdude |
B |
July 15, 2022, 5:25 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
124 |
31539200 |
|
|
164351013 |
iska_terminator |
B |
July 15, 2022, 5:25 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
139 |
29081600 |
|
|
164375653 |
NKUCristiano |
B |
July 15, 2022, 11:37 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
139 |
31232000 |
|
|
164343332 |
solyrion. |
B |
July 15, 2022, 4:28 p.m. |
OK |
PyPy 3-64 |
TESTS |
14 |
139 |
33280000 |
|
|
164385109 |
eugalt |
B |
July 16, 2022, 2:41 a.m. |
OK |
Python 3 |
TESTS |
14 |
108 |
14028800 |
|
|
164342133 |
eugalt |
B |
July 15, 2022, 4:22 p.m. |
OK |
Python 3 |
TESTS |
14 |
109 |
19865600 |
|
|
164365326 |
gogagum |
B |
July 15, 2022, 8:07 p.m. |
OK |
Python 3 |
TESTS |
14 |
124 |
17510400 |
|
|
164361106 |
alduin0 |
B |
July 15, 2022, 7:10 p.m. |
OK |
Python 3 |
TESTS |
14 |
124 |
17510400 |
|
|
164344729 |
eugalt |
B |
July 15, 2022, 4:35 p.m. |
OK |
Python 3 |
TESTS |
14 |
124 |
19763200 |
|
|
164375976 |
WJ.L |
B |
July 15, 2022, 11:47 p.m. |
OK |
Python 3 |
TESTS |
14 |
140 |
14028800 |
|
|
164380648 |
_syed_badar_ |
B |
July 16, 2022, 1:34 a.m. |
OK |
Python 3 |
TESTS |
14 |
140 |
17510400 |
|
|
164346394 |
technuts01 |
B |
July 15, 2022, 4:46 p.m. |
OK |
Python 3 |
TESTS |
14 |
140 |
17510400 |
|
|
164345445 |
tony_lenc_ |
B |
July 15, 2022, 4:40 p.m. |
OK |
Python 3 |
TESTS |
14 |
140 |
17510400 |
|
|
164363975 |
Radon23 |
B |
July 15, 2022, 7:47 p.m. |
OK |
Python 3 |
TESTS |
14 |
140 |
17920000 |
|
|
164377898 |
magnus.hegdahl |
B |
July 16, 2022, 12:41 a.m. |
OK |
Rust 2021 |
TESTS |
14 |
15 |
921600 |
|
|
164377840 |
magnus.hegdahl |
B |
July 16, 2022, 12:40 a.m. |
OK |
Rust 2021 |
TESTS |
14 |
15 |
1024000 |
|
|
164361930 |
bjin |
B |
July 15, 2022, 7:21 p.m. |
OK |
Rust 2021 |
TESTS |
14 |
77 |
5836800 |
|
|
164344339 |
Ragib_Hasin |
B |
July 15, 2022, 4:33 p.m. |
OK |
Rust 2021 |
TESTS |
14 |
140 |
0 |
|
|
remove filters
Back to search problems