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'Alice has n books. The 1 -st book contains a_1 pages, the 2 -nd book contains a_2 pages, ldots , the n -th book contains a_n pages. Alice does the following: Alice loves reading very much. Help her find the maximum total number of pages she can read by dividing the books into two piles. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 500 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 100 ) -- the number of books Alice has. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the number of pages in each book. For each test case, output a single integer -- the maximum number of pages Alice can read. In the first test case, Alice can put book number 1 in the first pile, and book number 2 in the second pile. Then she will read a_1 + a_2 = 1 + 1 = 2 pages. In the second test case, Alice can put books with numbers 2 and 3 in the first pile, and books with numbers 1 and 4 in the second pile. Then she will read the book with the highest number 3 from the first pile, and the book with the highest number 4 from the second pile. Then she will read a_3 + a_4 = 3 + 1 = 4 pages. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
266121432 |
KevinTorres01 |
A |
June 17, 2024, 1:06 a.m. |
OK |
C# 10 |
TESTS |
4 |
93 |
3072000 |
|
|
266134087 |
Zhang_Wenjie |
A |
June 17, 2024, 4:51 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
31 |
0 |
|
|
266136086 |
luffy_2311 |
A |
June 17, 2024, 5:19 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266134888 |
vishwavirus8010 |
A |
June 17, 2024, 5:02 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266133900 |
helloarjun111 |
A |
June 17, 2024, 4:49 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266130244 |
ar.cfid |
A |
June 17, 2024, 3:50 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266124140 |
new_95 |
A |
June 17, 2024, 2:07 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266122358 |
CapClark |
A |
June 17, 2024, 1:29 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266119497 |
Grammar_hbw |
A |
June 17, 2024, 12:08 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266121708 |
LuckyYu |
A |
June 17, 2024, 1:13 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266136777 |
random_user_az |
A |
June 17, 2024, 5:28 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
4 |
46 |
0 |
|
|
266070551 |
priyanshuog |
A |
June 16, 2024, 2:03 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266138468 |
palakkthakkar |
A |
June 17, 2024, 5:48 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266133854 |
aprajita_99 |
A |
June 17, 2024, 4:48 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266131213 |
HolyFuk |
A |
June 17, 2024, 4:07 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266125212 |
bourbon111 |
A |
June 17, 2024, 2:30 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266104959 |
rakib2017 |
A |
June 16, 2024, 6:58 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266100255 |
avacatocapt |
A |
June 16, 2024, 6:07 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266094145 |
sunkenship884 |
A |
June 16, 2024, 5:09 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266087014 |
sandeep31 |
A |
June 16, 2024, 4:06 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266077625 |
Kazake |
A |
June 16, 2024, 2:54 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
4 |
31 |
0 |
|
|
266091231 |
_GOM3A_ |
A |
June 16, 2024, 4:42 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
30 |
0 |
|
|
266109702 |
demonshide |
A |
June 16, 2024, 8:05 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266137021 |
NikitaPro228Master |
A |
June 17, 2024, 5:31 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266132464 |
IzzyAbello |
A |
June 17, 2024, 4:27 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266131071 |
AsadulloAbduev |
A |
June 17, 2024, 4:04 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266129839 |
habibie.lukman |
A |
June 17, 2024, 3:45 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266128039 |
try_my_hardest |
A |
June 17, 2024, 3:18 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266127023 |
rishijha00007 |
A |
June 17, 2024, 3:01 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266112820 |
TonyWasHere |
A |
June 16, 2024, 9:04 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266105254 |
AnchalDubey |
A |
June 16, 2024, 7:02 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
4 |
31 |
0 |
|
|
266065808 |
bluemegane |
A |
June 16, 2024, 1:24 p.m. |
OK |
C# 8 |
TESTS |
4 |
140 |
2969600 |
|
|
266103596 |
Alexanderter10 |
A |
June 16, 2024, 6:42 p.m. |
OK |
FPC |
TESTS |
4 |
46 |
0 |
|
|
266076333 |
NenadDapic |
A |
June 16, 2024, 2:44 p.m. |
OK |
FPC |
TESTS |
4 |
62 |
0 |
|
|
266078448 |
kaen_ |
A |
June 16, 2024, 3 p.m. |
OK |
GNU C11 |
TESTS |
4 |
31 |
0 |
|
|
266108564 |
Rafin_49 |
A |
June 16, 2024, 7:48 p.m. |
OK |
GNU C11 |
TESTS |
4 |
31 |
102400 |
|
|
266069547 |
atharvatol04 |
A |
June 16, 2024, 1:55 p.m. |
OK |
GNU C11 |
TESTS |
4 |
31 |
102400 |
|
|
266075818 |
HS4Y |
A |
June 16, 2024, 2:40 p.m. |
OK |
GNU C11 |
TESTS |
4 |
31 |
307200 |
|
|
266095058 |
Adityas_231000004 |
A |
June 16, 2024, 5:17 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
0 |
|
|
266106674 |
swastikdas1504 |
A |
June 16, 2024, 7:21 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
102400 |
|
|
266137650 |
madD0Gim |
A |
June 17, 2024, 5:38 a.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
102400 |
|
|
266097401 |
sparshsinha11 |
A |
June 16, 2024, 5:38 p.m. |
OK |
GNU C11 |
TESTS |
4 |
46 |
102400 |
|
|
266110591 |
saaad |
A |
June 16, 2024, 8:21 p.m. |
OK |
GNU C11 |
TESTS |
4 |
61 |
0 |
|
|
266070052 |
rohan1010 |
A |
June 16, 2024, 1:59 p.m. |
OK |
GNU C11 |
TESTS |
4 |
61 |
0 |
|
|
266124033 |
tom_pan1901 |
A |
June 17, 2024, 2:05 a.m. |
OK |
Go |
TESTS |
4 |
62 |
716800 |
|
|
266108328 |
prajjwalit |
A |
June 16, 2024, 7:44 p.m. |
OK |
Go |
TESTS |
4 |
359 |
3686400 |
|
|
266069856 |
Kalentsov_Maxim_8m |
A |
June 16, 2024, 1:58 p.m. |
OK |
Haskell |
TESTS |
4 |
187 |
0 |
|
|
266075132 |
Batman102 |
A |
June 16, 2024, 2:34 p.m. |
OK |
Java 21 |
TESTS |
4 |
186 |
716800 |
|
|
266106053 |
OsamaNassar |
A |
June 16, 2024, 7:13 p.m. |
OK |
Java 21 |
TESTS |
4 |
202 |
0 |
|
|
266133462 |
aplaypeak |
A |
June 17, 2024, 4:42 a.m. |
OK |
Java 21 |
TESTS |
4 |
203 |
409600 |
|
|
266083972 |
nithin_bharathi |
A |
June 16, 2024, 3:42 p.m. |
OK |
Java 21 |
TESTS |
4 |
218 |
409600 |
|
|
266067495 |
priyaroy3370 |
A |
June 16, 2024, 1:38 p.m. |
OK |
Java 21 |
TESTS |
4 |
218 |
409600 |
|
|
266112281 |
lpychemistry |
A |
June 16, 2024, 8:53 p.m. |
OK |
Java 21 |
TESTS |
4 |
218 |
614400 |
|
|
266113377 |
powervic08 |
A |
June 16, 2024, 9:16 p.m. |
OK |
Java 21 |
TESTS |
4 |
233 |
0 |
|
|
266088532 |
coder0687 |
A |
June 16, 2024, 4:19 p.m. |
OK |
Java 21 |
TESTS |
4 |
233 |
409600 |
|
|
266112850 |
dzhi |
A |
June 16, 2024, 9:05 p.m. |
OK |
Java 21 |
TESTS |
4 |
233 |
512000 |
|
|
266070032 |
krish1832 |
A |
June 16, 2024, 1:59 p.m. |
OK |
Java 21 |
TESTS |
4 |
234 |
512000 |
|
|
266137339 |
Harman_Singh |
A |
June 17, 2024, 5:34 a.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266135524 |
MoodySinner |
A |
June 17, 2024, 5:11 a.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266131873 |
coderman2004 |
A |
June 17, 2024, 4:17 a.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266079247 |
shashankp10 |
A |
June 16, 2024, 3:06 p.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266074237 |
jaideep151097 |
A |
June 16, 2024, 2:26 p.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266067532 |
MarPal |
A |
June 16, 2024, 1:38 p.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
0 |
|
|
266077389 |
Sumitsingh7 |
A |
June 16, 2024, 2:52 p.m. |
OK |
Java 8 |
TESTS |
4 |
140 |
6758400 |
|
|
266095131 |
gomudayya |
A |
June 16, 2024, 5:18 p.m. |
OK |
Java 8 |
TESTS |
4 |
155 |
0 |
|
|
266091595 |
NerfThis |
A |
June 16, 2024, 4:45 p.m. |
OK |
Java 8 |
TESTS |
4 |
156 |
0 |
|
|
266120154 |
Kushal_12 |
A |
June 17, 2024, 12:29 a.m. |
OK |
Java 8 |
TESTS |
4 |
171 |
0 |
|
|
266086666 |
bio-duplex |
A |
June 16, 2024, 4:03 p.m. |
OK |
Kotlin 1.9 |
TESTS |
4 |
202 |
614400 |
|
|
266096029 |
Tharun_P.T.S |
A |
June 16, 2024, 5:26 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
156 |
3686400 |
|
|
266074628 |
Krish_Agarwal0109 |
A |
June 16, 2024, 2:30 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
171 |
3276800 |
|
|
266100304 |
sedun1dnes |
A |
June 16, 2024, 6:07 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
171 |
3686400 |
|
|
266127574 |
nealzane |
A |
June 17, 2024, 3:10 a.m. |
OK |
PyPy 3 |
TESTS |
4 |
217 |
4710400 |
|
|
266080528 |
SHIVANG12 |
A |
June 16, 2024, 3:15 p.m. |
OK |
PyPy 3 |
TESTS |
4 |
249 |
3993600 |
|
|
266121045 |
MdAbedin |
A |
June 17, 2024, 12:55 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
1638400 |
|
|
266136653 |
Youarenotgood |
A |
June 17, 2024, 5:26 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
1740800 |
|
|
266116252 |
c00lbr8in |
A |
June 16, 2024, 10:27 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
77 |
1740800 |
|
|
266106032 |
singh.eureka |
A |
June 16, 2024, 7:12 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
78 |
1843200 |
|
|
266116341 |
divingsea11 |
A |
June 16, 2024, 10:30 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
92 |
1843200 |
|
|
266098272 |
cybsbbb |
A |
June 16, 2024, 5:47 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
92 |
2355200 |
|
|
266107548 |
noob_username |
A |
June 16, 2024, 7:33 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
92 |
3174400 |
|
|
266068212 |
AyuAnchor |
A |
June 16, 2024, 1:44 p.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
1433600 |
|
|
266123322 |
mikeac |
A |
June 17, 2024, 1:50 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
1536000 |
|
|
266122936 |
Newbie_ |
A |
June 17, 2024, 1:42 a.m. |
OK |
PyPy 3-64 |
TESTS |
4 |
93 |
1536000 |
|
|
266092800 |
pushpa2.0 |
A |
June 16, 2024, 4:56 p.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
266067000 |
Screech |
A |
June 16, 2024, 1:33 p.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
0 |
|
|
266072461 |
Avinash_27 |
A |
June 16, 2024, 2:11 p.m. |
OK |
Python 3 |
TESTS |
4 |
61 |
1024000 |
|
|
266129359 |
yagnesh2004 |
A |
June 17, 2024, 3:37 a.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266123366 |
LeMichael52 |
A |
June 17, 2024, 1:51 a.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266101646 |
lollasrichandra9 |
A |
June 16, 2024, 6:20 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266096762 |
f0xg02 |
A |
June 16, 2024, 5:33 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266088371 |
dhawal_23 |
A |
June 16, 2024, 4:18 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266085012 |
rishav447 |
A |
June 16, 2024, 3:51 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266073763 |
woowenjun99 |
A |
June 16, 2024, 2:22 p.m. |
OK |
Python 3 |
TESTS |
4 |
62 |
0 |
|
|
266097977 |
0x81 |
A |
June 16, 2024, 5:44 p.m. |
OK |
Ruby 3 |
TESTS |
4 |
327 |
1536000 |
|
|
266116137 |
M1ngXu |
A |
June 16, 2024, 10:24 p.m. |
OK |
Rust 2021 |
TESTS |
4 |
46 |
0 |
|
|
266109073 |
sgrigoryan |
A |
June 16, 2024, 7:55 p.m. |
OK |
Rust 2021 |
TESTS |
4 |
46 |
0 |
|
|
266087376 |
torio |
A |
June 16, 2024, 4:09 p.m. |
OK |
Rust 2021 |
TESTS |
4 |
46 |
4198400 |
|
|
266096954 |
Tomoya_11 |
A |
June 16, 2024, 5:35 p.m. |
OK |
Rust 2021 |
TESTS |
4 |
93 |
0 |
|
|
remove filters
Back to search problems