結果

問題 No.1716 Bonus Nim
ユーザー HydruHydru
提出日時 2021-10-22 23:58:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 737 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 1,041 ms
コンパイル使用メモリ 81,368 KB
実行使用メモリ 149,500 KB
最終ジャッジ日時 2023-10-24 16:18:01
合計ジャッジ時間 6,558 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,384 KB
testcase_01 AC 36 ms
55,432 KB
testcase_02 AC 36 ms
55,432 KB
testcase_03 AC 36 ms
55,432 KB
testcase_04 AC 212 ms
121,192 KB
testcase_05 AC 254 ms
129,896 KB
testcase_06 AC 180 ms
135,104 KB
testcase_07 AC 189 ms
130,372 KB
testcase_08 AC 202 ms
119,296 KB
testcase_09 AC 165 ms
127,624 KB
testcase_10 AC 218 ms
141,996 KB
testcase_11 AC 211 ms
130,376 KB
testcase_12 AC 205 ms
128,928 KB
testcase_13 AC 230 ms
146,696 KB
testcase_14 AC 220 ms
129,324 KB
testcase_15 AC 737 ms
77,924 KB
testcase_16 AC 38 ms
53,408 KB
testcase_17 AC 37 ms
55,456 KB
testcase_18 AC 37 ms
55,456 KB
testcase_19 AC 36 ms
55,456 KB
testcase_20 AC 37 ms
55,456 KB
testcase_21 AC 36 ms
55,456 KB
testcase_22 AC 217 ms
145,744 KB
testcase_23 AC 146 ms
119,492 KB
testcase_24 AC 192 ms
149,500 KB
testcase_25 AC 182 ms
139,080 KB
testcase_26 AC 204 ms
135,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import exit
from collections import Counter
t=int(input())
for _ in range(t):
    n=int(input())
    A=list(map(int,input().split()))
    if n%2==1:
        print("Alice")
        continue
    
    x=0
    for a in A:
        x^=a
    cntA=Counter(A)
    flag=1
    for x in cntA:
        if cntA[x]%2==1:
            flag=0
            break
    if flag:
        print("Bob")
    else:
        print("Alice")
0