結果
問題 | No.2666 Decreasing Modulo Nim |
ユーザー | chineristAC |
提出日時 | 2024-03-08 23:54:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 172 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 82,132 KB |
実行使用メモリ | 146,080 KB |
最終ジャッジ日時 | 2024-09-29 20:57:05 |
合計ジャッジ時間 | 7,337 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 55 |
ソースコード
import sys from itertools import permutations from heapq import heappop,heappush from collections import deque import random import bisect input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) def solve(N,M,A): Q_xor = 0 for i in range(N): Q_xor ^= (A[i]//M) A[i] %= M if Q_xor: return "Alice" while sum(A)!=0: if sum(A) & 1: return "Alice" A = [a>>1 for a in A] return "Bob" N,M = mi() A = li() print(solve(N,M,A))