結果

問題 No.2666 Decreasing Modulo Nim
ユーザー chineristACchineristAC
提出日時 2024-03-08 23:54:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 555 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 145,792 KB
最終ジャッジ日時 2024-03-08 23:54:50
合計ジャッジ時間 7,605 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
56,116 KB
testcase_01 AC 45 ms
56,116 KB
testcase_02 AC 45 ms
56,116 KB
testcase_03 AC 65 ms
77,104 KB
testcase_04 AC 160 ms
135,104 KB
testcase_05 AC 153 ms
134,224 KB
testcase_06 AC 56 ms
69,108 KB
testcase_07 AC 110 ms
98,424 KB
testcase_08 AC 71 ms
83,540 KB
testcase_09 AC 119 ms
107,976 KB
testcase_10 AC 95 ms
98,364 KB
testcase_11 AC 63 ms
75,984 KB
testcase_12 AC 58 ms
72,140 KB
testcase_13 AC 67 ms
81,668 KB
testcase_14 AC 59 ms
73,712 KB
testcase_15 AC 97 ms
97,220 KB
testcase_16 AC 58 ms
72,884 KB
testcase_17 AC 68 ms
81,976 KB
testcase_18 AC 78 ms
92,396 KB
testcase_19 AC 72 ms
87,448 KB
testcase_20 AC 69 ms
83,608 KB
testcase_21 AC 103 ms
97,456 KB
testcase_22 AC 57 ms
72,196 KB
testcase_23 AC 56 ms
72,156 KB
testcase_24 AC 63 ms
74,512 KB
testcase_25 AC 62 ms
75,840 KB
testcase_26 AC 83 ms
96,364 KB
testcase_27 AC 78 ms
87,744 KB
testcase_28 AC 109 ms
97,680 KB
testcase_29 AC 94 ms
98,508 KB
testcase_30 AC 109 ms
98,708 KB
testcase_31 AC 77 ms
89,628 KB
testcase_32 AC 91 ms
100,788 KB
testcase_33 AC 107 ms
102,112 KB
testcase_34 AC 54 ms
68,368 KB
testcase_35 AC 102 ms
97,244 KB
testcase_36 AC 79 ms
92,596 KB
testcase_37 AC 100 ms
96,972 KB
testcase_38 AC 130 ms
100,664 KB
testcase_39 AC 54 ms
68,372 KB
testcase_40 AC 90 ms
98,520 KB
testcase_41 AC 77 ms
89,844 KB
testcase_42 AC 77 ms
89,860 KB
testcase_43 AC 46 ms
56,116 KB
testcase_44 AC 45 ms
56,116 KB
testcase_45 AC 170 ms
145,792 KB
testcase_46 AC 144 ms
127,100 KB
testcase_47 AC 107 ms
102,020 KB
testcase_48 AC 107 ms
102,016 KB
testcase_49 AC 147 ms
103,680 KB
testcase_50 AC 108 ms
102,028 KB
testcase_51 AC 108 ms
102,024 KB
testcase_52 AC 107 ms
102,028 KB
testcase_53 AC 170 ms
145,020 KB
testcase_54 AC 110 ms
102,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0