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_1, a_2, ... , a_n , where all elements are different. You have to perform exactly k operations with it. During each operation, you do exactly one of the following two actions (you choose which to do yourself): You have to calculate the maximum possible sum of elements in the resulting array. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of two lines: Additional constraint on the input: the sum of n does not exceed 2 cdot 10^5 . For each test case, print one integer -- the maximum possible sum of elements in the resulting array. In the first testcase, applying the first operation produces the following outcome: 21 is the best answer. In the second testcase, it's optimal to first erase two minimums, then a maximum. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
205953630 |
tabibi |
B |
May 15, 2023, 7:44 a.m. |
OK |
C# 10 |
TESTS |
9 |
140 |
18329600 |
|
1100 |
205938238 |
CosAlpha |
B |
May 15, 2023, 3:52 a.m. |
OK |
C# 10 |
TESTS |
9 |
155 |
22630400 |
|
1100 |
206157359 |
bluemegane |
B |
May 16, 2023, 9:40 p.m. |
OK |
C# 8 |
TESTS |
9 |
202 |
19865600 |
|
1100 |
205802300 |
sofiazy |
B |
May 14, 2023, 7:55 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
9 |
265 |
1843200 |
|
1100 |
206076238 |
chenTAT |
B |
May 16, 2023, 10:53 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
9 |
202 |
1740800 |
|
1100 |
206040030 |
Seriously_Its_Sameer |
B |
May 16, 2023, 2:31 a.m. |
OK |
GNU C11 |
TESTS |
9 |
93 |
819200 |
|
1100 |
206101374 |
lalala. |
B |
May 16, 2023, 2:45 p.m. |
OK |
GNU C11 |
TESTS |
9 |
93 |
819200 |
|
1100 |
205932394 |
parvezahmed404 |
B |
May 15, 2023, 1:40 a.m. |
OK |
GNU C11 |
TESTS |
9 |
93 |
2355200 |
|
1100 |
206006389 |
parijatg ImagineTime |
B |
May 15, 2023, 4:05 p.m. |
OK |
GNU C11 |
TESTS |
9 |
109 |
1638400 |
|
1100 |
205838299 |
jackal-w |
B |
May 14, 2023, 1:43 p.m. |
OK |
GNU C11 |
TESTS |
9 |
109 |
4812800 |
|
1100 |
205794043 |
shebao |
B |
May 14, 2023, 6:44 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
46 |
819200 |
|
1100 |
206193726 |
zzy-yyds |
B |
May 17, 2023, 9:54 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
819200 |
|
1100 |
206079652 |
FreshOrange |
B |
May 16, 2023, 11:28 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
1843200 |
|
1100 |
206182655 |
scu_zzk |
B |
May 17, 2023, 7:56 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206106601 |
32bitThug |
B |
May 16, 2023, 3:35 p.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206316902 |
kkk0 |
B |
May 18, 2023, 8:56 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206313041 |
sizihan |
B |
May 18, 2023, 8:17 a.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206212092 |
WEXI7111 |
B |
May 17, 2023, 12:50 p.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206354634 |
Bingowo |
B |
May 18, 2023, 2:49 p.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206367484 |
wayzhang |
B |
May 18, 2023, 4:55 p.m. |
OK |
GNU C++14 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
205834350 |
hyyw051228 |
B |
May 14, 2023, 12:59 p.m. |
OK |
GNU C++17 |
TESTS |
9 |
61 |
2355200 |
|
1100 |
205810894 |
Gold_Dragon |
B |
May 14, 2023, 9:09 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
819200 |
|
1100 |
206400101 |
Trigerrr |
B |
May 19, 2023, 3:33 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
819200 |
|
1100 |
205949729 |
SoiMae |
B |
May 15, 2023, 6:57 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
819200 |
|
1100 |
205902519 |
MyVegetableHasExploded |
B |
May 14, 2023, 4:45 p.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
819200 |
|
1100 |
206305034 |
Nuclear_05 |
B |
May 18, 2023, 6:44 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
2355200 |
|
1100 |
205984823 |
Omar_Alaa03 |
B |
May 15, 2023, 1:09 p.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
2355200 |
|
1100 |
205805956 |
_Rahim_17 |
B |
May 14, 2023, 8:27 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
2355200 |
|
1100 |
206437714 |
abubakarsiddi0 |
B |
May 19, 2023, 11:11 a.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
206210367 |
201716080213 |
B |
May 17, 2023, 12:34 p.m. |
OK |
GNU C++17 |
TESTS |
9 |
62 |
2457600 |
|
1100 |
205768627 |
efficient |
B |
May 13, 2023, 9:44 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
819200 |
|
1100 |
206282071 |
Krzychuo |
B |
May 17, 2023, 9:27 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
819200 |
|
1100 |
205985322 |
rky673 |
B |
May 15, 2023, 1:14 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
819200 |
|
1100 |
205906383 |
avicodes |
B |
May 14, 2023, 5:40 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
819200 |
|
1100 |
205775457 |
Rakib03 |
B |
May 14, 2023, 1:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
819200 |
|
1100 |
206404290 |
Irmuun.Ch |
B |
May 19, 2023, 4:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
1638400 |
|
1100 |
205894051 |
muzizhou |
B |
May 14, 2023, 4:09 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
1638400 |
|
1100 |
206210152 |
Noureldein |
B |
May 17, 2023, 12:33 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
2355200 |
|
1100 |
206193560 |
Dread.t |
B |
May 17, 2023, 9:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
2457600 |
|
1100 |
206372792 |
Aviously |
B |
May 18, 2023, 5:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
9 |
46 |
2457600 |
|
1100 |
205783532 |
Yychen |
B |
May 14, 2023, 4:47 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
205774195 |
A7medAkl |
B |
May 14, 2023, 12:57 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
206341010 |
llking |
B |
May 18, 2023, 12:45 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
206097641 |
Huyum_nik_fan |
B |
May 16, 2023, 2:09 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
206089806 |
adk120920 |
B |
May 16, 2023, 12:59 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
206005630 |
2021sgy |
B |
May 15, 2023, 3:57 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
205831983 |
vf21 |
B |
May 14, 2023, 12:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
1638400 |
|
1100 |
205778577 |
tsk101 |
B |
May 14, 2023, 3:10 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
2355200 |
|
1100 |
205992520 |
gugg |
B |
May 15, 2023, 1:52 p.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
2355200 |
|
1100 |
206195678 |
Ann |
B |
May 17, 2023, 10:16 a.m. |
OK |
GNU C++20 (64) |
TESTS |
9 |
31 |
2457600 |
|
1100 |
205977561 |
lordvidex |
B |
May 15, 2023, 12:03 p.m. |
OK |
Go |
TESTS |
9 |
62 |
9625600 |
|
1100 |
205822709 |
habibulka |
B |
May 14, 2023, 10:51 a.m. |
OK |
Java 11 |
TESTS |
9 |
233 |
0 |
|
1100 |
205783881 |
gaju_01 |
B |
May 14, 2023, 4:53 a.m. |
OK |
Java 11 |
TESTS |
9 |
233 |
3379200 |
|
1100 |
206084589 |
Panther369 |
B |
May 16, 2023, 12:14 p.m. |
OK |
Java 11 |
TESTS |
9 |
234 |
0 |
|
1100 |
206359076 |
muskan_smileee |
B |
May 18, 2023, 3:30 p.m. |
OK |
Java 11 |
TESTS |
9 |
249 |
0 |
|
1100 |
206142303 |
jxin31415 |
B |
May 16, 2023, 5:55 p.m. |
OK |
Java 11 |
TESTS |
9 |
249 |
0 |
|
1100 |
205837450 |
MuhammD_husss |
B |
May 14, 2023, 1:33 p.m. |
OK |
Java 11 |
TESTS |
9 |
280 |
2457600 |
|
1100 |
206394728 |
Un_sung |
B |
May 19, 2023, 1:26 a.m. |
OK |
Java 11 |
TESTS |
9 |
311 |
0 |
|
1100 |
206212164 |
NithinBharathi |
B |
May 17, 2023, 12:51 p.m. |
OK |
Java 11 |
TESTS |
9 |
311 |
2662400 |
|
1100 |
206330159 |
ilasiawo |
B |
May 18, 2023, 11:09 a.m. |
OK |
Java 11 |
TESTS |
9 |
452 |
0 |
|
1100 |
205951715 |
too_depressed |
B |
May 15, 2023, 7:21 a.m. |
OK |
Java 11 |
TESTS |
9 |
452 |
0 |
|
1100 |
206017078 |
Vrutik_2809 |
B |
May 15, 2023, 5:58 p.m. |
OK |
Java 17 |
TESTS |
9 |
202 |
307200 |
|
1100 |
206292521 |
ajxu2 |
B |
May 18, 2023, 3:10 a.m. |
OK |
Java 17 |
TESTS |
9 |
202 |
409600 |
|
1100 |
206011265 |
Suraj1607 |
B |
May 15, 2023, 4:56 p.m. |
OK |
Java 17 |
TESTS |
9 |
233 |
204800 |
|
1100 |
205988105 |
ManasR_2003 |
B |
May 15, 2023, 1:24 p.m. |
OK |
Java 17 |
TESTS |
9 |
233 |
614400 |
|
1100 |
205973785 |
TCchen |
B |
May 15, 2023, 11:29 a.m. |
OK |
Java 17 |
TESTS |
9 |
264 |
0 |
|
1100 |
206245172 |
Atuer |
B |
May 17, 2023, 4:11 p.m. |
OK |
Java 17 |
TESTS |
9 |
265 |
409600 |
|
1100 |
205942884 |
dracarys_1105 |
B |
May 15, 2023, 5:14 a.m. |
OK |
Java 17 |
TESTS |
9 |
265 |
921600 |
|
1100 |
206146107 |
SuprHUlk |
B |
May 16, 2023, 6:35 p.m. |
OK |
Java 17 |
TESTS |
9 |
295 |
819200 |
|
1100 |
206001583 |
nigamabhai03 |
B |
May 15, 2023, 3:17 p.m. |
OK |
Java 17 |
TESTS |
9 |
311 |
307200 |
|
1100 |
205933004 |
jport Aemon |
B |
May 15, 2023, 1:59 a.m. |
OK |
Java 17 |
TESTS |
9 |
312 |
1331200 |
|
1100 |
206049982 |
ZXF_521mua |
B |
May 16, 2023, 5:41 a.m. |
OK |
Java 8 |
TESTS |
9 |
202 |
0 |
|
1100 |
205809831 |
madhav2800 |
B |
May 14, 2023, 8:58 a.m. |
OK |
Java 8 |
TESTS |
9 |
218 |
4403200 |
|
1100 |
205809729 |
madhav2800 |
B |
May 14, 2023, 8:57 a.m. |
OK |
Java 8 |
TESTS |
9 |
218 |
4403200 |
|
1100 |
206180435 |
aniket27 |
B |
May 17, 2023, 7:29 a.m. |
OK |
Java 8 |
TESTS |
9 |
234 |
4608000 |
|
1100 |
205957231 |
lakshay.sharma.ug21 |
B |
May 15, 2023, 8:29 a.m. |
OK |
Java 8 |
TESTS |
9 |
249 |
0 |
|
1100 |
205950165 |
OldBlack |
B |
May 15, 2023, 7:02 a.m. |
OK |
Java 8 |
TESTS |
9 |
249 |
0 |
|
1100 |
206299572 |
PP_2023 |
B |
May 18, 2023, 5:28 a.m. |
OK |
Java 8 |
TESTS |
9 |
452 |
0 |
|
1100 |
206299602 |
PP_2023 |
B |
May 18, 2023, 5:28 a.m. |
OK |
Java 8 |
TESTS |
9 |
467 |
0 |
|
1100 |
206111903 |
shbhmgl |
B |
May 16, 2023, 3:45 p.m. |
OK |
Java 8 |
TESTS |
9 |
467 |
0 |
|
1100 |
206001846 |
Juhaied_nabid |
B |
May 15, 2023, 3:19 p.m. |
OK |
Java 8 |
TESTS |
9 |
467 |
0 |
|
1100 |
206408757 |
GusztavSzmolik |
B |
May 19, 2023, 6:02 a.m. |
OK |
Mono C# |
TESTS |
9 |
140 |
19660800 |
|
1100 |
206386792 |
k3x9_ |
B |
May 18, 2023, 8:55 p.m. |
OK |
Mono C# |
TESTS |
9 |
187 |
25804800 |
|
1100 |
205776059 |
sqrt81 |
B |
May 14, 2023, 2:04 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
78 |
2457600 |
|
1100 |
206192376 |
breatre |
B |
May 17, 2023, 9:40 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
78 |
4403200 |
|
1100 |
206327308 |
Gadi |
B |
May 18, 2023, 10:42 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
202 |
819200 |
|
1100 |
205765979 |
Gadi |
B |
May 13, 2023, 8:54 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
202 |
4812800 |
|
1100 |
205956853 |
TX-W |
B |
May 15, 2023, 8:24 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
233 |
1638400 |
|
1100 |
205823850 |
yosefeyad024 |
B |
May 14, 2023, 11:02 a.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
249 |
1536000 |
|
1100 |
206100159 |
EbuYandex |
B |
May 16, 2023, 2:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
9 |
280 |
4915200 |
|
1100 |
206285327 |
UnclePodger |
B |
May 17, 2023, 11:26 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
576 |
19148800 |
|
1100 |
205939140 |
neerajam |
B |
May 15, 2023, 4:09 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
576 |
20889600 |
|
1100 |
206280563 |
ipip |
B |
May 17, 2023, 8:48 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
576 |
24780800 |
|
1100 |
206137246 |
KingPRaj |
B |
May 16, 2023, 5:07 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
576 |
24780800 |
|
1100 |
205823291 |
anupam_sudh |
B |
May 14, 2023, 10:57 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
592 |
18841600 |
|
1100 |
206255072 |
lalith_6055 |
B |
May 17, 2023, 5:21 p.m. |
OK |
PyPy 3 |
TESTS |
9 |
592 |
20684800 |
|
1100 |
205799189 |
shikamarubyte |
B |
May 14, 2023, 7:30 a.m. |
OK |
PyPy 3 |
TESTS |
9 |
592 |
22630400 |
|
1100 |
205767151 |
layzer |
B |
May 13, 2023, 9:14 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
139 |
30105600 |
|
1100 |
205784052 |
Green_Shadow |
B |
May 14, 2023, 4:55 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
155 |
27545600 |
|
1100 |
205909878 |
Marco_Lau |
B |
May 14, 2023, 6:23 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
155 |
29593600 |
|
1100 |
206148107 |
I_Am_That |
B |
May 16, 2023, 6:59 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
156 |
27545600 |
|
1100 |
206005620 |
practiceaccount76 |
B |
May 15, 2023, 3:57 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
170 |
21401600 |
|
1100 |
205955473 |
kaashmonee |
B |
May 15, 2023, 8:08 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
171 |
23859200 |
|
1100 |
206354216 |
tomasnyberg |
B |
May 18, 2023, 2:45 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
171 |
26828800 |
|
1100 |
206054513 |
BlackSpectre |
B |
May 16, 2023, 6:45 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
171 |
28569600 |
|
1100 |
205840755 |
Titan_4 |
B |
May 14, 2023, 2:10 p.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
171 |
32870400 |
|
1100 |
206180610 |
violetd |
B |
May 17, 2023, 7:32 a.m. |
OK |
PyPy 3-64 |
TESTS |
9 |
186 |
27852800 |
|
1100 |
206192921 |
PROKOR-RUDRO |
B |
May 17, 2023, 9:45 a.m. |
OK |
Python 3 |
TESTS |
9 |
186 |
28672000 |
|
1100 |
206401709 |
oscary324 |
B |
May 19, 2023, 4:04 a.m. |
OK |
Python 3 |
TESTS |
9 |
187 |
28672000 |
|
1100 |
205970059 |
2000030996-akanksha |
B |
May 15, 2023, 10:52 a.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
26214400 |
|
1100 |
206387257 |
stevieC |
B |
May 18, 2023, 9:05 p.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
26521600 |
|
1100 |
206032817 |
Mehrdadt |
B |
May 15, 2023, 10:13 p.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
28672000 |
|
1100 |
206018410 |
sridharsiddi |
B |
May 15, 2023, 6:13 p.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
28672000 |
|
1100 |
205960066 |
2000030103 |
B |
May 15, 2023, 9:01 a.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
28672000 |
|
1100 |
205841958 |
srinija_chowdary9 |
B |
May 14, 2023, 2:24 p.m. |
OK |
Python 3 |
TESTS |
9 |
202 |
28672000 |
|
1100 |
206442804 |
2100030666.cseh |
B |
May 19, 2023, 12:02 p.m. |
OK |
Python 3 |
TESTS |
9 |
217 |
26214400 |
|
1100 |
206345905 |
rarevyom09 |
B |
May 18, 2023, 1:31 p.m. |
OK |
Python 3 |
TESTS |
9 |
217 |
28672000 |
|
1100 |
206297480 |
0x81 |
B |
May 18, 2023, 4:53 a.m. |
OK |
Ruby 3 |
TESTS |
9 |
452 |
18432000 |
|
1100 |
205870669 |
Lukiko |
B |
May 14, 2023, 3:08 p.m. |
OK |
Rust 2021 |
TESTS |
9 |
1263 |
6656000 |
|
1100 |
remove filters
Back to search problems