結果

問題 No.2666 Decreasing Modulo Nim
ユーザー ShirotsumeShirotsume
提出日時 2024-03-08 22:12:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 147,876 KB
最終ジャッジ日時 2024-03-08 22:12:24
合計ジャッジ時間 6,824 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
56,144 KB
testcase_01 AC 42 ms
56,144 KB
testcase_02 AC 42 ms
56,144 KB
testcase_03 AC 63 ms
77,532 KB
testcase_04 AC 176 ms
138,020 KB
testcase_05 AC 147 ms
136,192 KB
testcase_06 AC 54 ms
71,172 KB
testcase_07 AC 106 ms
100,480 KB
testcase_08 AC 70 ms
84,424 KB
testcase_09 AC 115 ms
110,812 KB
testcase_10 AC 96 ms
100,560 KB
testcase_11 AC 61 ms
76,752 KB
testcase_12 AC 53 ms
70,316 KB
testcase_13 AC 63 ms
82,276 KB
testcase_14 AC 55 ms
73,988 KB
testcase_15 AC 90 ms
97,088 KB
testcase_16 AC 56 ms
73,188 KB
testcase_17 AC 63 ms
82,616 KB
testcase_18 AC 73 ms
93,036 KB
testcase_19 AC 66 ms
86,028 KB
testcase_20 AC 65 ms
84,188 KB
testcase_21 AC 102 ms
99,664 KB
testcase_22 AC 56 ms
72,876 KB
testcase_23 AC 55 ms
72,828 KB
testcase_24 AC 60 ms
75,184 KB
testcase_25 AC 61 ms
76,776 KB
testcase_26 AC 80 ms
98,688 KB
testcase_27 AC 70 ms
89,424 KB
testcase_28 AC 101 ms
99,832 KB
testcase_29 AC 87 ms
100,684 KB
testcase_30 AC 100 ms
100,292 KB
testcase_31 AC 69 ms
90,524 KB
testcase_32 AC 84 ms
102,320 KB
testcase_33 AC 100 ms
102,388 KB
testcase_34 AC 51 ms
68,500 KB
testcase_35 AC 95 ms
98,088 KB
testcase_36 AC 74 ms
93,364 KB
testcase_37 AC 96 ms
98,888 KB
testcase_38 AC 101 ms
100,344 KB
testcase_39 AC 52 ms
68,892 KB
testcase_40 AC 85 ms
100,696 KB
testcase_41 AC 71 ms
90,748 KB
testcase_42 AC 71 ms
90,796 KB
testcase_43 AC 42 ms
56,144 KB
testcase_44 AC 42 ms
56,144 KB
testcase_45 AC 163 ms
147,876 KB
testcase_46 AC 139 ms
129,056 KB
testcase_47 AC 102 ms
102,436 KB
testcase_48 AC 102 ms
102,416 KB
testcase_49 AC 110 ms
105,632 KB
testcase_50 AC 103 ms
103,972 KB
testcase_51 AC 100 ms
102,440 KB
testcase_52 AC 100 ms
102,440 KB
testcase_53 AC 161 ms
147,320 KB
testcase_54 AC 102 ms
103,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353

n, m = mi()
a = li()

def nim(a):
    x = 0
    for i in a:
        x ^= i
    return x

am = [v // m for v in a]
if nim(am):
    print('Alice')
else:
    am = [v % m for v in a]
    while sum(am):
        if sum(am) % 2:
            print('Alice')
            exit()
        am = [v // 2 for v in am]
    print('Bob')
    
0