結果

問題 No.2666 Decreasing Modulo Nim
ユーザー PNJPNJ
提出日時 2024-03-08 22:30:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 411 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 258,932 KB
最終ジャッジ日時 2024-09-29 19:59:55
合計ジャッジ時間 7,323 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 55
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
  RR = []
  for r in R:
    RR.append(r // 2)
  R = RR[:]
0