結果

問題 No.1506 Unbalanced Pocky Game
ユーザー gew1fw
提出日時 2025-06-12 12:54:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 339 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 82,664 KB
実行使用メモリ 105,936 KB
最終ジャッジ日時 2025-06-12 12:57:56
合計ジャッジ時間 6,114 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a = a[::-1]  # Reverse the array to process from end to start

grundy_prev = 0
xor_sum = 0

for ai in a:
    if ai > grundy_prev:
        current = ai - grundy_prev
    else:
        current = 0
    xor_sum ^= current
    grundy_prev = current

print("Alice" if xor_sum != 0 else "Bob")
0