結果

問題 No.1716 Bonus Nim
ユーザー ああいいああいい
提出日時 2022-03-16 20:35:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 713 ms / 2,000 ms
コード長 523 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 150,900 KB
最終ジャッジ日時 2023-10-25 03:31:53
合計ジャッジ時間 6,525 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,572 KB
testcase_01 AC 42 ms
55,620 KB
testcase_02 AC 41 ms
53,572 KB
testcase_03 AC 41 ms
53,572 KB
testcase_04 AC 174 ms
114,456 KB
testcase_05 AC 145 ms
116,896 KB
testcase_06 AC 136 ms
113,456 KB
testcase_07 AC 176 ms
117,372 KB
testcase_08 AC 177 ms
118,448 KB
testcase_09 AC 163 ms
128,044 KB
testcase_10 AC 225 ms
146,936 KB
testcase_11 AC 208 ms
125,948 KB
testcase_12 AC 226 ms
127,680 KB
testcase_13 AC 199 ms
131,028 KB
testcase_14 AC 227 ms
123,340 KB
testcase_15 AC 713 ms
78,856 KB
testcase_16 AC 41 ms
53,572 KB
testcase_17 AC 42 ms
55,620 KB
testcase_18 AC 42 ms
55,620 KB
testcase_19 AC 42 ms
55,620 KB
testcase_20 AC 42 ms
55,620 KB
testcase_21 AC 42 ms
55,620 KB
testcase_22 AC 207 ms
132,684 KB
testcase_23 AC 150 ms
119,768 KB
testcase_24 AC 207 ms
150,900 KB
testcase_25 AC 199 ms
138,588 KB
testcase_26 AC 229 ms
133,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
from collections import defaultdict
for _ in range(T):
    N = int(input())
    a = list(map(int,input().split()))
    if N % 2 == 1:
        print('Alice')
        continue
    S = 0
    for i in a:
        S ^= i
    if S != 0:
        print("Alice")
        continue
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    flag = False
    for v in d.values():
        if v % 2 == 1:
            print("Alice")
            flag = True
            break
    if flag == False:
        print("Bob")
0