結果

問題 No.582 キャンディー・ボックス3
ユーザー FromBooskaFromBooska
提出日時 2023-03-17 08:28:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,640 KB
実行使用メモリ 53,388 KB
最終ジャッジ日時 2023-10-18 13:30:38
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,388 KB
testcase_01 WA -
testcase_02 AC 38 ms
53,388 KB
testcase_03 AC 37 ms
53,388 KB
testcase_04 AC 37 ms
53,388 KB
testcase_05 AC 38 ms
53,388 KB
testcase_06 AC 37 ms
53,388 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 36 ms
53,388 KB
testcase_10 WA -
testcase_11 AC 37 ms
53,388 KB
testcase_12 AC 38 ms
53,388 KB
testcase_13 AC 38 ms
53,388 KB
testcase_14 AC 37 ms
53,388 KB
testcase_15 AC 37 ms
53,388 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 37 ms
53,388 KB
testcase_19 AC 38 ms
53,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# Grundy数でダメだった、確かに[1, 3]はGrundy数だと勝てるはずだけど負ける
# 先攻が勝てるのは手番で[1]または手番が終わって[1, 1]
# そうなるのは1が奇数個と2が1個だけか

N = int(input())
C = list(map(int, input().split()))
one_count = 0
two_or_more_count = 0
for i in range(N):
    if C[i] == 1:
        one_count += 1
    elif C[i] > 1:
        two_or_more_count += 1
if one_count == 1 and two_or_more_count == 0:
    print('A')
elif one_count%2 == 1 and two_or_more_count == 1:
    print('A')
else:
    print('B')
    
0