結果

問題 No.582 キャンディー・ボックス3
ユーザー FromBooskaFromBooska
提出日時 2023-09-25 11:33:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 71,620 KB
最終ジャッジ日時 2023-09-25 11:33:21
合計ジャッジ時間 3,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 69 ms
71,544 KB
testcase_04 AC 68 ms
71,416 KB
testcase_05 AC 70 ms
71,424 KB
testcase_06 AC 70 ms
71,356 KB
testcase_07 WA -
testcase_08 AC 71 ms
71,144 KB
testcase_09 AC 72 ms
71,200 KB
testcase_10 AC 70 ms
71,328 KB
testcase_11 AC 71 ms
71,456 KB
testcase_12 AC 72 ms
71,336 KB
testcase_13 AC 71 ms
71,024 KB
testcase_14 AC 70 ms
71,508 KB
testcase_15 AC 71 ms
71,352 KB
testcase_16 AC 71 ms
71,348 KB
testcase_17 WA -
testcase_18 AC 69 ms
71,420 KB
testcase_19 AC 70 ms
71,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# ゲーム、grundy数
# 箱1つで考えると、1のときだけ先手勝ち、あとは後手勝ち
# 箱複数、先手勝ちの時1、後手勝ちのとき0としてxor sum計算
# xor sumが1のとき先手勝ち、0のとき後手勝ち
# https://algo-logic.info/combinatorial-games/#

N = int(input())
C = list(map(int, input().split()))
A = []
for c in C:
    if c == 1:
        A.append(1)
    else:
        A.append(0)
xor_sum = 0
for a in A:
    xor_sum ^= a
if xor_sum == 1:
    print('A')
else:
    print('B')
0