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 and Bob are playing a game with n piles of stones. It is guaranteed that n is an even number. The i -th pile has a_i stones. Alice and Bob will play a game alternating turns with Alice going first. On a player 's turn, they must choose exactly frac{n}{2} nonempty piles and independently remove a positive number of stones from each of the chosen piles. They can remove a different number of stones from the piles in a single turn. The first player unable to make a move loses (when there are less than frac{n}{2} nonempty piles). Given the starting configuration, determine who will win the game. The first line contains one integer n ( 2 <= q n <= q 50 ) -- the number of piles. It is guaranteed that n is an even number. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 50 ) -- the number of stones in the piles. Print a single string "Alice" if Alice wins; otherwise, print "Bob" (without double quotes). In the first example, each player can only remove stones from one pile ( frac{2}{2}=1 ). Alice loses, since Bob can copy whatever Alice does on the other pile, so Alice will run out of moves first. In the second example, Alice can remove 2 stones from the first pile and 3 stones from the third pile on her first move to guarantee a win. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
56393648 |
luogu_bot2 |
C |
July 1, 2019, 1:37 p.m. |
OK |
FPC |
TESTS |
70 |
31 |
0 |
|
2100 |
66870759 |
1942938446 |
C |
Dec. 14, 2019, 1:39 p.m. |
OK |
FPC |
TESTS |
70 |
31 |
307200 |
|
2100 |
66809660 |
chenxi2015 |
C |
Dec. 14, 2019, 1:10 a.m. |
OK |
FPC |
TESTS |
70 |
31 |
614400 |
|
2100 |
54431811 |
Yair_Play |
C |
May 21, 2019, 12:30 a.m. |
OK |
GNU C11 |
TESTS |
70 |
31 |
0 |
|
2100 |
54432600 |
leches |
C |
May 21, 2019, 1:44 a.m. |
OK |
GNU C11 |
TESTS |
70 |
31 |
0 |
|
2100 |
59207175 |
vjudge4 |
C |
Aug. 21, 2019, 7:20 a.m. |
OK |
GNU C11 |
TESTS |
70 |
31 |
0 |
|
2100 |
55288146 |
mohitsethia |
C |
June 8, 2019, 6:15 a.m. |
OK |
GNU C11 |
TESTS |
70 |
31 |
0 |
|
2100 |
58401319 |
vitoria |
C |
Aug. 6, 2019, 5:56 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
0 |
|
2100 |
59202992 |
vjudge1 |
C |
Aug. 21, 2019, 5:48 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
30 |
0 |
|
2100 |
68494928 |
Liyi1 |
C |
Jan. 10, 2020, 1:05 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
68494922 |
luogu_bot5 |
C |
Jan. 10, 2020, 1:05 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
68492846 |
chenkeyi666 |
C |
Jan. 10, 2020, 12:20 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
68488657 |
luogu_bot3 |
C |
Jan. 10, 2020, 10:50 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
69471979 |
ryuIo |
C |
Jan. 24, 2020, 2:50 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
69720133 |
Mivik |
C |
Jan. 29, 2020, 10:21 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
69735401 |
ryuIo |
C |
Jan. 29, 2020, 2:29 p.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
68970799 |
keenlf |
C |
Jan. 17, 2020, 6:54 a.m. |
OK |
GNU C++11 |
TESTS |
70 |
31 |
0 |
|
2100 |
54071476 |
sea_26 |
C |
May 13, 2019, 4:31 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
53835752 |
cyrishikesh |
C |
May 7, 2019, 2:37 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
53808954 |
mehul1999k |
C |
May 6, 2019, 4:35 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
53769717 |
Origenes |
C |
May 5, 2019, 3:55 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
53765002 |
Cyber |
C |
May 4, 2019, 10:20 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
53755672 |
kfqg |
C |
May 4, 2019, 6:08 p.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
64569493 |
adyyy |
C |
Nov. 9, 2019, 8:42 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
57171943 |
WhatTheH3ck |
C |
July 17, 2019, 3:39 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
56299566 |
hocky |
C |
June 30, 2019, 8:05 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
54480296 |
Roohi |
C |
May 22, 2019, 10:43 a.m. |
OK |
GNU C++14 |
TESTS |
70 |
30 |
0 |
|
2100 |
59914297 |
.I. |
C |
Sept. 2, 2019, 6:29 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
30 |
0 |
|
2100 |
56523802 |
aditya_sheth |
C |
July 4, 2019, 4:12 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
30 |
0 |
|
2100 |
54340936 |
YuKoito |
C |
May 18, 2019, 10:17 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
30 |
0 |
|
2100 |
53791386 |
Rtn_e |
C |
May 5, 2019, 1:01 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
30 |
204800 |
|
2100 |
68128135 |
Amireza |
C |
Jan. 3, 2020, 3:59 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
30 |
819200 |
|
2100 |
66482636 |
ioer_lhx |
C |
Dec. 8, 2019, 3:56 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
31 |
0 |
|
2100 |
68012925 |
BRs82 |
C |
Dec. 31, 2019, 4:47 p.m. |
OK |
GNU C++17 |
TESTS |
70 |
31 |
0 |
|
2100 |
67960396 |
My_Soul_Loves_ALLAH |
C |
Dec. 30, 2019, 11:19 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
31 |
0 |
|
2100 |
67001117 |
dontquit |
C |
Dec. 16, 2019, 5:46 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
31 |
0 |
|
2100 |
66809588 |
renbaoshuo |
C |
Dec. 14, 2019, 1:06 a.m. |
OK |
GNU C++17 |
TESTS |
70 |
31 |
0 |
|
2100 |
53955077 |
vaibhavpulastya |
C |
May 10, 2019, 11:33 a.m. |
OK |
Java 8 |
TESTS |
70 |
109 |
0 |
|
2100 |
53766188 |
liymbear |
C |
May 5, 2019, 12:01 a.m. |
OK |
Java 8 |
TESTS |
70 |
109 |
0 |
|
2100 |
55195881 |
mTvTm |
C |
June 6, 2019, 8:28 a.m. |
OK |
Java 8 |
TESTS |
70 |
124 |
0 |
|
2100 |
54888737 |
Nutella3000 |
C |
May 31, 2019, 6:57 p.m. |
OK |
Java 8 |
TESTS |
70 |
124 |
0 |
|
2100 |
54078939 |
alphacarrot |
C |
May 14, 2019, 12:07 a.m. |
OK |
Java 8 |
TESTS |
70 |
124 |
0 |
|
2100 |
53771915 |
jenish9599 |
C |
May 5, 2019, 6:01 a.m. |
OK |
Java 8 |
TESTS |
70 |
124 |
0 |
|
2100 |
53764091 |
Suzukaze |
C |
May 4, 2019, 9:19 p.m. |
OK |
Java 8 |
TESTS |
70 |
124 |
0 |
|
2100 |
62211512 |
F-Mu |
C |
Oct. 9, 2019, 2:38 p.m. |
OK |
Java 8 |
TESTS |
70 |
140 |
0 |
|
2100 |
61101810 |
priyadesai12 |
C |
Sept. 23, 2019, 7:12 a.m. |
OK |
Java 8 |
TESTS |
70 |
140 |
0 |
|
2100 |
57734187 |
yaoct |
C |
July 25, 2019, 9:27 a.m. |
OK |
Java 8 |
TESTS |
70 |
140 |
0 |
|
2100 |
59208276 |
vjudge4 |
C |
Aug. 21, 2019, 7:42 a.m. |
OK |
MS C++ |
TESTS |
70 |
31 |
0 |
|
2100 |
57171158 |
vjudge1 |
C |
July 17, 2019, 3:06 a.m. |
OK |
MS C++ |
TESTS |
70 |
31 |
0 |
|
2100 |
57169745 |
vjudge4 |
C |
July 17, 2019, 2:18 a.m. |
OK |
MS C++ |
TESTS |
70 |
31 |
0 |
|
2100 |
59205664 |
vjudge2 |
C |
Aug. 21, 2019, 6:49 a.m. |
OK |
MS C++ |
TESTS |
70 |
46 |
0 |
|
2100 |
59204671 |
vjudge2 |
C |
Aug. 21, 2019, 6:28 a.m. |
OK |
MS C++ |
TESTS |
70 |
46 |
0 |
|
2100 |
59205829 |
vjudge5 |
C |
Aug. 21, 2019, 6:53 a.m. |
OK |
MS C++ |
TESTS |
70 |
62 |
0 |
|
2100 |
57146589 |
GeeknessEmbodied |
C |
July 16, 2019, 1:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
70 |
31 |
0 |
|
2100 |
53901720 |
HatsuneMikuo |
C |
May 9, 2019, 10:38 a.m. |
OK |
PyPy 3 |
TESTS |
70 |
139 |
0 |
|
2100 |
58385366 |
ahManoTravei |
C |
Aug. 6, 2019, 11:44 a.m. |
OK |
PyPy 3 |
TESTS |
70 |
140 |
102400 |
|
2100 |
58242511 |
JoseRenan |
C |
Aug. 4, 2019, 2:33 a.m. |
OK |
PyPy 3 |
TESTS |
70 |
140 |
102400 |
|
2100 |
54001753 |
74TrAkToR |
C |
May 11, 2019, 4:50 p.m. |
OK |
Python 3 |
TESTS |
70 |
109 |
0 |
|
2100 |
53894092 |
gion.li |
C |
May 9, 2019, 4:01 a.m. |
OK |
Python 3 |
TESTS |
70 |
109 |
0 |
|
2100 |
53894014 |
Shisuko |
C |
May 9, 2019, 3:56 a.m. |
OK |
Python 3 |
TESTS |
70 |
109 |
0 |
|
2100 |
53877598 |
vvvb |
C |
May 8, 2019, 12:50 p.m. |
OK |
Python 3 |
TESTS |
70 |
109 |
0 |
|
2100 |
53840592 |
_Dx_ |
C |
May 7, 2019, 7:14 a.m. |
OK |
Python 3 |
TESTS |
70 |
109 |
0 |
|
2100 |
67656118 |
MinecraftFuns |
C |
Dec. 26, 2019, 1:58 p.m. |
OK |
Python 3 |
TESTS |
70 |
124 |
307200 |
|
2100 |
63107576 |
sansen |
C |
Oct. 22, 2019, 5:46 a.m. |
OK |
Rust |
TESTS |
70 |
46 |
0 |
|
2100 |
remove filters
Back to search problems