結果

問題 No.2059 Odd Move Nim
ユーザー lam6er
提出日時 2025-04-15 20:54:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,604 KB
実行使用メモリ 102,508 KB
最終ジャッジ日時 2025-04-15 20:58:10
合計ジャッジ時間 2,728 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

even_xor = 0
odd_xor = 0

for i in range(1, n):
    if (i + 1) % 2 == 0:  # since a[0] is pile 1, i=0 corresponds to pile 1
        even_xor ^= a[i]
    else:
        odd_xor ^= a[i]

total = even_xor ^ odd_xor
print("Alice" if total != 0 else "Bob")
0