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'During their New Year holidays, Alice and Bob play the following game using an array a of n integers: If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared. For example, if n = 4 and a = [5, 2, 7, 3] , then the game could go as follows (there are other options): You want to find out who will win if both players play optimally. Note that there may be duplicate numbers in the array. The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains an integer n ( 1 <= n <= 2 cdot 10^5 ) -- the number of elements in the array a . The next line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- the array a used to play the game. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output on a separate line: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
103309367 |
ruban |
D |
Jan. 4, 2021, 5:12 p.m. |
OK |
Delphi |
TESTS |
13 |
202 |
105881600 |
|
|
103334727 |
Vilespine_Slayer |
D |
Jan. 5, 2021, 1:23 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
46 |
819200 |
|
|
103308363 |
zjh2017 |
D |
Jan. 4, 2021, 5:05 p.m. |
OK |
GNU C++11 |
TESTS |
13 |
46 |
819200 |
|
|
103341444 |
Rainer1116 |
D |
Jan. 5, 2021, 4:31 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
46 |
1638400 |
|
|
103338654 |
SnhPhuc |
D |
Jan. 5, 2021, 3:29 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
61 |
819200 |
|
|
103336467 |
20050901 |
D |
Jan. 5, 2021, 2:24 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
61 |
1638400 |
|
|
103344004 |
run_with_sunshine |
D |
Jan. 5, 2021, 5:33 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
61 |
3174400 |
|
|
103338190 |
wangskyone |
D |
Jan. 5, 2021, 3:17 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
62 |
819200 |
|
|
103340892 |
hanyaqi010924 |
D |
Jan. 5, 2021, 4:20 a.m. |
OK |
GNU C++11 |
TESTS |
13 |
62 |
819200 |
|
|
103313380 |
georgerapeanu |
D |
Jan. 4, 2021, 5:46 p.m. |
OK |
GNU C++11 |
TESTS |
13 |
62 |
819200 |
|
|
103307727 |
willful |
D |
Jan. 4, 2021, 5:01 p.m. |
OK |
GNU C++11 |
TESTS |
13 |
62 |
1228800 |
|
|
103324775 |
ansergeyg |
D |
Jan. 4, 2021, 8:21 p.m. |
OK |
.NET Core C# |
TESTS |
13 |
155 |
29184000 |
|
|
remove filters
Back to search problems