結果
| 問題 |
No.2666 Decreasing Modulo Nim
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-03-08 22:56:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 515 bytes |
| コンパイル時間 | 305 ms |
| コンパイル使用メモリ | 82,032 KB |
| 実行使用メモリ | 131,028 KB |
| 最終ジャッジ日時 | 2024-09-29 20:25:16 |
| 合計ジャッジ時間 | 6,763 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 45 WA * 10 |
ソースコード
from collections import defaultdict
N,M=map(int,input().split())
A=list(map(int,input().split()))
nim=0
dic=defaultdict(int)
div=0
for i in range(N):
nim^=(A[i]//M)
if A[i]%M>0:
dic[A[i]%M]+=1
div+=A[i]%M
if nim>0:
print('Alice')
exit(0)
#和を奇数にしたら勝ち。
if div%2==1:
print('Alice')
exit(0)
left=2
for i in range(30):
nim2=0
for i in range(N):
nim2^=(A[i]//left)
if nim2>0:
print('Alice')
exit(0)
left*=2
print('Bob')
nikoro256