結果
問題 |
No.2666 Decreasing Modulo Nim
|
ユーザー |
![]() |
提出日時 | 2024-03-08 22:32:59 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 118 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 507 ms |
コンパイル使用メモリ | 82,420 KB |
実行使用メモリ | 109,420 KB |
最終ジャッジ日時 | 2024-09-29 20:02:20 |
合計ジャッジ時間 | 6,038 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
n,m = map(int,input().split()) A = list(map(int,input().split())) B = [A[i]//m for i in range(n)] g = 0 for b in B: g ^= b if g > 0: print('Alice') exit() R = [A[i] % m for i in range(n)] while True: if sum(R) == 0: print('Bob') exit() if sum(R) % 2 == 1: print('Alice') exit() for i in range(n): R[i] //= 2