結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,612 KB
testcase_01 AC 42 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 85 ms
76,684 KB
testcase_12 AC 59 ms
75,844 KB
testcase_13 AC 87 ms
94,984 KB
testcase_14 AC 63 ms
78,832 KB
testcase_15 AC 121 ms
101,008 KB
testcase_16 AC 58 ms
72,880 KB
testcase_17 AC 69 ms
84,056 KB
testcase_18 AC 84 ms
95,252 KB
testcase_19 AC 70 ms
87,332 KB
testcase_20 AC 67 ms
85,676 KB
testcase_21 AC 140 ms
124,460 KB
testcase_22 AC 59 ms
75,908 KB
testcase_23 AC 60 ms
75,864 KB
testcase_24 AC 66 ms
81,064 KB
testcase_25 AC 71 ms
81,736 KB
testcase_26 AC 86 ms
97,884 KB
testcase_27 AC 74 ms
88,644 KB
testcase_28 AC 100 ms
99,184 KB
testcase_29 AC 86 ms
98,108 KB
testcase_30 AC 146 ms
129,832 KB
testcase_31 AC 95 ms
107,372 KB
testcase_32 AC 119 ms
100,780 KB
testcase_33 AC 142 ms
119,520 KB
testcase_34 AC 56 ms
71,744 KB
testcase_35 AC 110 ms
98,748 KB
testcase_36 AC 86 ms
95,324 KB
testcase_37 AC 100 ms
98,336 KB
testcase_38 AC 106 ms
98,740 KB
testcase_39 AC 68 ms
68,128 KB
testcase_40 AC 152 ms
95,816 KB
testcase_41 AC 68 ms
89,444 KB
testcase_42 AC 74 ms
89,504 KB
testcase_43 AC 42 ms
53,460 KB
testcase_44 AC 43 ms
53,460 KB
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 159 ms
130,384 KB
testcase_48 AC 139 ms
111,796 KB
testcase_49 AC 159 ms
130,508 KB
testcase_50 AC 125 ms
103,096 KB
testcase_51 AC 152 ms
130,372 KB
testcase_52 AC 122 ms
102,076 KB
testcase_53 AC 208 ms
101,092 KB
testcase_54 AC 111 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):
    nim2=0
    for i in range(N):
        nim2^=(A[i]//left)
    if nim2>0:
        print('Alice')
        exit(0)
    left*=2
print('Bob')
0