結果

問題 No.2666 Decreasing Modulo Nim
ユーザー nikoro256nikoro256
提出日時 2024-03-09 00:26:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 130,524 KB
最終ジャッジ日時 2024-03-09 00:26:45
合計ジャッジ時間 8,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,460 KB
testcase_01 AC 40 ms
53,460 KB
testcase_02 AC 41 ms
53,460 KB
testcase_03 AC 75 ms
73,740 KB
testcase_04 AC 220 ms
124,708 KB
testcase_05 AC 242 ms
130,388 KB
testcase_06 AC 61 ms
70,060 KB
testcase_07 AC 136 ms
98,152 KB
testcase_08 AC 78 ms
80,076 KB
testcase_09 AC 121 ms
98,796 KB
testcase_10 AC 96 ms
97,856 KB
testcase_11 AC 66 ms
76,680 KB
testcase_12 AC 60 ms
75,844 KB
testcase_13 AC 80 ms
94,984 KB
testcase_14 AC 65 ms
78,832 KB
testcase_15 AC 125 ms
101,000 KB
testcase_16 AC 60 ms
72,880 KB
testcase_17 AC 90 ms
84,056 KB
testcase_18 AC 95 ms
95,252 KB
testcase_19 AC 72 ms
87,332 KB
testcase_20 AC 70 ms
85,676 KB
testcase_21 AC 143 ms
124,468 KB
testcase_22 AC 61 ms
75,908 KB
testcase_23 AC 60 ms
75,864 KB
testcase_24 AC 78 ms
81,064 KB
testcase_25 AC 70 ms
81,736 KB
testcase_26 AC 87 ms
97,884 KB
testcase_27 AC 77 ms
88,644 KB
testcase_28 AC 101 ms
99,184 KB
testcase_29 AC 87 ms
98,108 KB
testcase_30 AC 183 ms
129,832 KB
testcase_31 AC 97 ms
107,372 KB
testcase_32 AC 119 ms
100,780 KB
testcase_33 AC 147 ms
119,524 KB
testcase_34 AC 58 ms
71,744 KB
testcase_35 AC 109 ms
98,748 KB
testcase_36 AC 85 ms
95,324 KB
testcase_37 AC 125 ms
98,336 KB
testcase_38 AC 106 ms
98,740 KB
testcase_39 AC 50 ms
68,000 KB
testcase_40 AC 76 ms
94,664 KB
testcase_41 AC 71 ms
89,444 KB
testcase_42 AC 71 ms
89,504 KB
testcase_43 AC 42 ms
53,460 KB
testcase_44 AC 43 ms
53,460 KB
testcase_45 AC 240 ms
130,516 KB
testcase_46 AC 185 ms
106,308 KB
testcase_47 AC 181 ms
130,396 KB
testcase_48 AC 138 ms
111,816 KB
testcase_49 AC 160 ms
130,524 KB
testcase_50 AC 124 ms
103,108 KB
testcase_51 AC 154 ms
130,384 KB
testcase_52 AC 124 ms
102,080 KB
testcase_53 AC 190 ms
101,084 KB
testcase_54 AC 107 ms
100,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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):
    if left>M:
        break
    nim2=0
    for i in range(N):
        nim2+=(A[i]%M//left)
    if nim2%2>0:
        print('Alice')
        exit(0)
    left*=2
print('Bob')
0