結果

問題 No.2666 Decreasing Modulo Nim
ユーザー nikoro256nikoro256
提出日時 2024-03-08 23:20:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 130,520 KB
最終ジャッジ日時 2024-03-08 23:20:41
合計ジャッジ時間 7,449 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 40 ms
53,460 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 61 ms
76,684 KB
testcase_12 AC 59 ms
75,844 KB
testcase_13 AC 77 ms
94,984 KB
testcase_14 AC 64 ms
78,832 KB
testcase_15 AC 121 ms
100,884 KB
testcase_16 AC 58 ms
72,880 KB
testcase_17 AC 70 ms
84,056 KB
testcase_18 AC 82 ms
95,252 KB
testcase_19 AC 69 ms
87,332 KB
testcase_20 AC 68 ms
85,676 KB
testcase_21 AC 146 ms
124,468 KB
testcase_22 AC 61 ms
75,908 KB
testcase_23 AC 60 ms
75,864 KB
testcase_24 AC 66 ms
81,064 KB
testcase_25 AC 66 ms
81,736 KB
testcase_26 AC 86 ms
97,884 KB
testcase_27 AC 76 ms
88,644 KB
testcase_28 AC 100 ms
99,184 KB
testcase_29 AC 86 ms
98,108 KB
testcase_30 AC 142 ms
129,828 KB
testcase_31 AC 94 ms
107,372 KB
testcase_32 AC 114 ms
100,780 KB
testcase_33 AC 137 ms
119,520 KB
testcase_34 AC 56 ms
71,744 KB
testcase_35 AC 106 ms
98,748 KB
testcase_36 AC 82 ms
95,324 KB
testcase_37 AC 97 ms
98,336 KB
testcase_38 AC 102 ms
98,740 KB
testcase_39 AC 50 ms
68,000 KB
testcase_40 AC 75 ms
94,664 KB
testcase_41 AC 68 ms
89,444 KB
testcase_42 AC 70 ms
89,504 KB
testcase_43 AC 39 ms
53,460 KB
testcase_44 AC 40 ms
53,460 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 147 ms
130,396 KB
testcase_48 AC 136 ms
111,808 KB
testcase_49 AC 152 ms
130,520 KB
testcase_50 AC 125 ms
103,104 KB
testcase_51 AC 148 ms
130,384 KB
testcase_52 AC 120 ms
102,084 KB
testcase_53 AC 199 ms
101,084 KB
testcase_54 AC 105 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]//left)
    if nim2%2>0:
        print('Alice')
        exit(0)
    left*=2
print('Bob')
0