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"William has array of n numbers a_1, a_2, ... , a_n . He can perform the following sequence of operations any number of times: Help William find the maximal sum of array elements, which he can get by performing the sequence of operations described above. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains an integer n (1 <= n <= 15) , the number of elements in William's array. The second line contains n integers a_1, a_2, ... , a_n (1 <= a_i < 16) , the contents of William's array. For each test case output the maximal sum of array elements after performing an optimal sequence of operations. In the first example test case the optimal sequence would be: The final answer 48 + 1 + 1 = 50 . In the third example test case there is no way to change the sum of elements, so the answer is 10 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
137253265 |
Happytown |
A |
Nov. 28, 2021, 4:02 p.m. |
OK |
GNU C11 |
TESTS |
3 |
46 |
0 |
|
900 |
137263421 |
SXBLSY |
A |
Nov. 28, 2021, 4:47 p.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
900 |
137274072 |
Partha_sarothi |
A |
Nov. 28, 2021, 6:29 p.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
900 |
137274192 |
Partha_sarothi |
A |
Nov. 28, 2021, 6:31 p.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
900 |
137289664 |
dianzikejidaxue |
A |
Nov. 29, 2021, 2:41 a.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
900 |
137293621 |
777888 |
A |
Nov. 29, 2021, 4:37 a.m. |
OK |
GNU C11 |
TESTS |
3 |
62 |
0 |
|
900 |
137310018 |
murali_33 |
A |
Nov. 29, 2021, 5:04 a.m. |
OK |
GNU C11 |
TESTS |
3 |
77 |
0 |
|
900 |
137269082 |
777888 |
A |
Nov. 28, 2021, 5:32 p.m. |
OK |
GNU C11 |
TESTS |
3 |
77 |
0 |
|
900 |
137263558 |
realFZzzz |
A |
Nov. 28, 2021, 4:48 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
0 |
|
900 |
137285820 |
sunzihao |
A |
Nov. 28, 2021, 11:54 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
0 |
|
900 |
137282049 |
ahme_dh |
A |
Nov. 28, 2021, 9:23 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
204800 |
|
900 |
137288338 |
FluffyBunny |
A |
Nov. 29, 2021, 1:55 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
15 |
819200 |
|
900 |
137293477 |
zefyrus |
A |
Nov. 29, 2021, 4:33 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
30 |
0 |
|
900 |
137288488 |
PhaiCoGiaiQuocGia |
A |
Nov. 29, 2021, 2 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
30 |
0 |
|
900 |
137269263 |
123ampagp |
A |
Nov. 28, 2021, 5:33 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
30 |
102400 |
|
900 |
137273391 |
ABOGBL |
A |
Nov. 28, 2021, 6:20 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
30 |
102400 |
|
900 |
137258103 |
Pes_is_better_than_fifa |
A |
Nov. 28, 2021, 4:22 p.m. |
OK |
GNU C++14 |
TESTS |
3 |
30 |
1024000 |
|
900 |
137310616 |
pradhanboy |
A |
Nov. 29, 2021, 5:16 a.m. |
OK |
GNU C++14 |
TESTS |
3 |
31 |
0 |
|
900 |
137291992 |
AmitRai |
A |
Nov. 29, 2021, 3:53 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
0 |
|
900 |
137276941 |
oneforthidiot |
A |
Nov. 28, 2021, 7:20 p.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
102400 |
|
900 |
137286834 |
binminh01 |
A |
Nov. 29, 2021, 12:49 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
102400 |
|
900 |
137311747 |
Mandrake01 |
A |
Nov. 29, 2021, 5:37 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
102400 |
|
900 |
137293676 |
kritarth403 |
A |
Nov. 29, 2021, 4:38 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137255033 |
sorenrani |
A |
Nov. 28, 2021, 4:09 p.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137290463 |
plexius |
A |
Nov. 29, 2021, 3:06 a.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137274461 |
Anurag_20 |
A |
Nov. 28, 2021, 6:35 p.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137268936 |
Ahmedhossam11 |
A |
Nov. 28, 2021, 5:32 p.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137268873 |
EGCOBRA |
A |
Nov. 28, 2021, 5:31 p.m. |
OK |
GNU C++17 |
TESTS |
3 |
15 |
204800 |
|
900 |
137287662 |
tikul |
A |
Nov. 29, 2021, 1:27 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137310772 |
suryakantpandey |
A |
Nov. 29, 2021, 5:19 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137309805 |
Niloy_Das_19 |
A |
Nov. 29, 2021, 5:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137290420 |
Prasantgupta52 |
A |
Nov. 29, 2021, 3:04 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137290215 |
A.R.A |
A |
Nov. 29, 2021, 2:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137278986 |
Evang |
A |
Nov. 28, 2021, 8:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137278548 |
emorgan5289 |
A |
Nov. 28, 2021, 7:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137278167 |
fuad161 |
A |
Nov. 28, 2021, 7:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137277989 |
inksamurai |
A |
Nov. 28, 2021, 7:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137276853 |
3am0rab1 |
A |
Nov. 28, 2021, 7:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137286809 |
wygzgyw |
A |
Nov. 29, 2021, 12:47 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137286376 |
pandey_04 |
A |
Nov. 29, 2021, 12:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137281422 |
Muhammedalajam |
A |
Nov. 28, 2021, 9:04 p.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137278994 |
mAnThAn_NOOB |
A |
Nov. 28, 2021, 8:04 p.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137278144 |
gaserashraf |
A |
Nov. 28, 2021, 7:45 p.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137289610 |
HodaKamal |
A |
Nov. 29, 2021, 2:39 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137292083 |
nathan_luiz |
A |
Nov. 29, 2021, 3:55 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137292705 |
VinsenN |
A |
Nov. 29, 2021, 4:12 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137293345 |
Shohan_Suvro |
A |
Nov. 29, 2021, 4:30 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137311074 |
pranjayvats22062001 |
A |
Nov. 29, 2021, 5:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
3 |
15 |
0 |
|
900 |
137287214 |
TienNguyen411 |
A |
Nov. 29, 2021, 1:08 a.m. |
OK |
Java 11 |
TESTS |
3 |
155 |
0 |
|
900 |
137292316 |
Satyaa |
A |
Nov. 29, 2021, 4:01 a.m. |
OK |
Java 11 |
TESTS |
3 |
170 |
0 |
|
900 |
137312795 |
aashay_03 |
A |
Nov. 29, 2021, 5:54 a.m. |
OK |
Java 11 |
TESTS |
3 |
171 |
0 |
|
900 |
137254991 |
ace_halfling |
A |
Nov. 28, 2021, 4:09 p.m. |
OK |
Java 11 |
TESTS |
3 |
171 |
0 |
|
900 |
137269634 |
the_unseen |
A |
Nov. 28, 2021, 5:36 p.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
900 |
137256436 |
singhshivsm20001 |
A |
Nov. 28, 2021, 4:15 p.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
900 |
137271420 |
SaberXpro |
A |
Nov. 28, 2021, 5:53 p.m. |
OK |
Java 11 |
TESTS |
3 |
186 |
0 |
|
900 |
137310853 |
solo07 |
A |
Nov. 29, 2021, 5:20 a.m. |
OK |
Java 11 |
TESTS |
3 |
187 |
0 |
|
900 |
137293527 |
Srikanth1777 |
A |
Nov. 29, 2021, 4:34 a.m. |
OK |
Java 11 |
TESTS |
3 |
187 |
0 |
|
900 |
137285871 |
ramuked |
A |
Nov. 28, 2021, 11:57 p.m. |
OK |
Java 11 |
TESTS |
3 |
202 |
0 |
|
900 |
137277899 |
omar_mohammed |
A |
Nov. 28, 2021, 7:40 p.m. |
OK |
Java 8 |
TESTS |
3 |
124 |
0 |
|
900 |
137297167 |
gssakash |
A |
Nov. 29, 2021, 4:44 a.m. |
OK |
Java 8 |
TESTS |
3 |
124 |
0 |
|
900 |
137285959 |
less_ordinary |
A |
Nov. 29, 2021, 12:02 a.m. |
OK |
Java 8 |
TESTS |
3 |
124 |
0 |
|
900 |
137277116 |
_Eyepatch |
A |
Nov. 28, 2021, 7:23 p.m. |
OK |
Java 8 |
TESTS |
3 |
139 |
0 |
|
900 |
137275250 |
darvesh_23 |
A |
Nov. 28, 2021, 6:48 p.m. |
OK |
Java 8 |
TESTS |
3 |
171 |
0 |
|
900 |
137274658 |
md_tashhirul_islam |
A |
Nov. 28, 2021, 6:38 p.m. |
OK |
Java 8 |
TESTS |
3 |
202 |
0 |
|
900 |
137254215 |
suraj__ |
A |
Nov. 28, 2021, 4:05 p.m. |
OK |
Java 8 |
TESTS |
3 |
202 |
0 |
|
900 |
137271178 |
akhilesh_2410 |
A |
Nov. 28, 2021, 5:50 p.m. |
OK |
Java 8 |
TESTS |
3 |
202 |
0 |
|
900 |
137285749 |
Maikyh04 |
A |
Nov. 28, 2021, 11:51 p.m. |
OK |
Java 8 |
TESTS |
3 |
218 |
0 |
|
900 |
137257283 |
msubhojit58 |
A |
Nov. 28, 2021, 4:18 p.m. |
OK |
Java 8 |
TESTS |
3 |
249 |
0 |
|
900 |
137258417 |
Kejml |
A |
Nov. 28, 2021, 4:23 p.m. |
OK |
Kotlin 1.5 |
TESTS |
3 |
327 |
0 |
|
900 |
137272916 |
Domilz |
A |
Nov. 28, 2021, 6:13 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
78 |
0 |
|
900 |
137271401 |
Domilz |
A |
Nov. 28, 2021, 5:53 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
93 |
0 |
|
900 |
137253531 |
nikuradze2006 |
A |
Nov. 28, 2021, 4:03 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
124 |
0 |
|
900 |
137270081 |
karim.elsa3d100 |
A |
Nov. 28, 2021, 5:39 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
124 |
0 |
|
900 |
137260664 |
WYYW |
A |
Nov. 28, 2021, 4:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
124 |
0 |
|
900 |
137252492 |
xinple |
A |
Nov. 28, 2021, 3:59 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
124 |
102400 |
|
900 |
137253087 |
Fish_L |
A |
Nov. 28, 2021, 4:01 p.m. |
OK |
MS C++ 2017 |
TESTS |
3 |
155 |
0 |
|
900 |
137256278 |
ansergeyg |
A |
Nov. 28, 2021, 4:14 p.m. |
OK |
.NET Core C# |
TESTS |
3 |
77 |
3481600 |
|
900 |
137287784 |
thetansquared |
A |
Nov. 29, 2021, 1:33 a.m. |
OK |
.NET Core C# |
TESTS |
3 |
155 |
3174400 |
|
900 |
137270113 |
asutosh1998 |
A |
Nov. 28, 2021, 5:39 p.m. |
OK |
.NET Core C# |
TESTS |
3 |
155 |
3379200 |
|
900 |
137282218 |
turch |
A |
Nov. 28, 2021, 9:29 p.m. |
OK |
Node.js |
TESTS |
3 |
202 |
5632000 |
|
900 |
137256271 |
dotdot11 |
A |
Nov. 28, 2021, 4:14 p.m. |
OK |
Node.js |
TESTS |
3 |
311 |
6144000 |
|
900 |
137275553 |
whatshisbucket |
A |
Nov. 28, 2021, 6:53 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
140 |
5632000 |
|
900 |
137275881 |
whatshisbucket |
A |
Nov. 28, 2021, 6:58 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
155 |
5734400 |
|
900 |
137276204 |
whatshisbucket |
A |
Nov. 28, 2021, 7:04 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
155 |
6451200 |
|
900 |
137276113 |
whatshisbucket |
A |
Nov. 28, 2021, 7:02 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
155 |
6553600 |
|
900 |
137276365 |
whatshisbucket |
A |
Nov. 28, 2021, 7:07 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
171 |
6451200 |
|
900 |
137276412 |
whatshisbucket |
A |
Nov. 28, 2021, 7:08 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
6451200 |
|
900 |
137276125 |
AbnerShen |
A |
Nov. 28, 2021, 7:02 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
186 |
6553600 |
|
900 |
137290532 |
puffc0rn |
A |
Nov. 29, 2021, 3:08 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
187 |
70451200 |
|
900 |
137279235 |
mathdude42 |
A |
Nov. 28, 2021, 8:09 p.m. |
OK |
PyPy 3 |
TESTS |
3 |
202 |
6553600 |
|
900 |
137311762 |
hjkim |
A |
Nov. 29, 2021, 5:37 a.m. |
OK |
PyPy 3 |
TESTS |
3 |
202 |
7577600 |
|
900 |
137275777 |
lemiao12 |
A |
Nov. 28, 2021, 6:56 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
93 |
5734400 |
|
900 |
137312036 |
Sujith_ |
A |
Nov. 29, 2021, 5:42 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
139 |
20377600 |
|
900 |
137271120 |
guineapig |
A |
Nov. 28, 2021, 5:49 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
140 |
9523200 |
|
900 |
137275579 |
trying_ |
A |
Nov. 28, 2021, 6:54 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
155 |
9830400 |
|
900 |
137276245 |
_aadiupadhyay_ |
A |
Nov. 28, 2021, 7:05 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
171 |
8908800 |
|
900 |
137309966 |
aditya.kalra28 |
A |
Nov. 29, 2021, 5:03 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
186 |
10342400 |
|
900 |
137259513 |
sanbada79 |
A |
Nov. 28, 2021, 4:28 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
187 |
9728000 |
|
900 |
137293124 |
ghoshashis545 |
A |
Nov. 29, 2021, 4:24 a.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
218 |
12492800 |
|
900 |
137259112 |
eepsilon |
A |
Nov. 28, 2021, 4:26 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
280 |
9728000 |
|
900 |
137276567 |
samchen123 |
A |
Nov. 28, 2021, 7:11 p.m. |
OK |
PyPy 3-64 |
TESTS |
3 |
327 |
16998400 |
|
900 |
137272893 |
OLOGY |
A |
Nov. 28, 2021, 6:12 p.m. |
OK |
Python 2 |
TESTS |
3 |
186 |
1331200 |
|
900 |
137277566 |
elistark |
A |
Nov. 28, 2021, 7:33 p.m. |
OK |
Python 2 |
TESTS |
3 |
202 |
307200 |
|
900 |
137277542 |
dragonmushu |
A |
Nov. 28, 2021, 7:32 p.m. |
OK |
Python 2 |
TESTS |
3 |
358 |
102400 |
|
900 |
137282093 |
eugalt |
A |
Nov. 28, 2021, 9:24 p.m. |
OK |
Python 3 |
TESTS |
3 |
139 |
921600 |
|
900 |
137252678 |
tommypranay |
A |
Nov. 28, 2021, 4 p.m. |
OK |
Python 3 |
TESTS |
3 |
140 |
0 |
|
900 |
137274717 |
eugalt |
A |
Nov. 28, 2021, 6:39 p.m. |
OK |
Python 3 |
TESTS |
3 |
140 |
921600 |
|
900 |
137312417 |
anonymouslydemo |
A |
Nov. 29, 2021, 5:48 a.m. |
OK |
Python 3 |
TESTS |
3 |
155 |
0 |
|
900 |
137270798 |
eugalt |
A |
Nov. 28, 2021, 5:46 p.m. |
OK |
Python 3 |
TESTS |
3 |
155 |
921600 |
|
900 |
137256094 |
patulka |
A |
Nov. 28, 2021, 4:13 p.m. |
OK |
Python 3 |
TESTS |
3 |
155 |
4403200 |
|
900 |
137288806 |
xinzihang |
A |
Nov. 29, 2021, 2:13 a.m. |
OK |
Python 3 |
TESTS |
3 |
171 |
0 |
|
900 |
137269809 |
royaldelhi44 |
A |
Nov. 28, 2021, 5:37 p.m. |
OK |
Python 3 |
TESTS |
3 |
171 |
0 |
|
900 |
137274532 |
eugalt |
A |
Nov. 28, 2021, 6:36 p.m. |
OK |
Python 3 |
TESTS |
3 |
171 |
921600 |
|
900 |
137263896 |
wallet |
A |
Nov. 28, 2021, 4:49 p.m. |
OK |
Python 3 |
TESTS |
3 |
186 |
0 |
|
900 |
137284359 |
noogler |
A |
Nov. 28, 2021, 10:46 p.m. |
OK |
Rust |
TESTS |
3 |
15 |
0 |
|
900 |
137273269 |
Hyrulia |
A |
Nov. 28, 2021, 6:18 p.m. |
OK |
Rust |
TESTS |
3 |
124 |
0 |
|
900 |
137287117 |
Egor |
A |
Nov. 29, 2021, 1:04 a.m. |
OK |
Rust 2021 |
TESTS |
3 |
31 |
0 |
|
900 |
remove filters
Back to search problems