結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,460 KB
testcase_01 AC 41 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 63 ms
76,684 KB
testcase_12 AC 59 ms
75,844 KB
testcase_13 AC 78 ms
94,984 KB
testcase_14 AC 64 ms
78,832 KB
testcase_15 AC 123 ms
100,996 KB
testcase_16 AC 59 ms
72,880 KB
testcase_17 AC 69 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 141 ms
124,468 KB
testcase_22 AC 60 ms
75,908 KB
testcase_23 AC 60 ms
75,864 KB
testcase_24 AC 68 ms
81,064 KB
testcase_25 AC 69 ms
81,736 KB
testcase_26 AC 85 ms
97,884 KB
testcase_27 AC 76 ms
88,644 KB
testcase_28 AC 101 ms
99,056 KB
testcase_29 AC 86 ms
98,108 KB
testcase_30 AC 148 ms
129,828 KB
testcase_31 AC 97 ms
107,372 KB
testcase_32 AC 119 ms
100,780 KB
testcase_33 AC 145 ms
119,524 KB
testcase_34 AC 56 ms
71,744 KB
testcase_35 AC 107 ms
98,748 KB
testcase_36 AC 83 ms
95,324 KB
testcase_37 AC 100 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 69 ms
89,444 KB
testcase_42 AC 69 ms
89,504 KB
testcase_43 AC 40 ms
53,460 KB
testcase_44 AC 41 ms
53,460 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 150 ms
130,392 KB
testcase_48 AC 139 ms
111,808 KB
testcase_49 AC 162 ms
130,516 KB
testcase_50 AC 126 ms
103,104 KB
testcase_51 AC 152 ms
130,388 KB
testcase_52 AC 122 ms
102,084 KB
testcase_53 AC 198 ms
101,084 KB
testcase_54 AC 108 ms
100,960 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