結果
| 問題 |
No.1506 Unbalanced Pocky Game
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 18:13:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 339 bytes |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 106,168 KB |
| 最終ジャッジ日時 | 2025-06-12 18:15:05 |
| 合計ジャッジ時間 | 5,382 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 WA * 31 |
ソースコード
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")
gew1fw