結果
| 問題 | No.2666 Decreasing Modulo Nim |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-07-12 23:09:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| + 25µs | |
| コード長 | 472 bytes |
| 記録 | |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 95,960 KB |
| 実行使用メモリ | 121,464 KB |
| 最終ジャッジ日時 | 2026-07-12 23:09:29 |
| 合計ジャッジ時間 | 7,446 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 55 |
ソースコード
N, M = map(int, input().split())
A = list(map(int, input().split()))
def allXOR(A):
xor = 0
for a in A: xor ^= a
return xor
def solve(A):
if sum(A)%2 == 1:
return True
return allXOR([a//2 for a in A]) != 0
def answer(flag):
print("Alice" if flag else "Bob")
maxA = max(A)
if M <= maxA:
XOR = allXOR([a//M for a in A])
if XOR != 0:
answer(True)
else:
answer(solve([a%M for a in A]))
else:
answer(solve(A))
detteiuu