結果

問題 No.1716 Bonus Nim
ユーザー HydruHydru
提出日時 2021-10-22 23:47:45
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 668 bytes
コンパイル時間 1,670 ms
コンパイル使用メモリ 81,352 KB
実行使用メモリ 145,752 KB
最終ジャッジ日時 2023-10-24 16:06:14
合計ジャッジ時間 5,366 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,392 KB
testcase_01 RE -
testcase_02 AC 40 ms
55,396 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 39 ms
55,420 KB
testcase_18 AC 39 ms
55,420 KB
testcase_19 AC 40 ms
55,420 KB
testcase_20 AC 39 ms
55,420 KB
testcase_21 AC 40 ms
55,420 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 178 ms
139,096 KB
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

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
    if x==0:
        cntA=Counter(A)
        flag=1
        for x in cntA:
            if cntA[x]%2==1:
                flag=0
                break
        if flag:
            print("Bob")
        else:
            print("Alice")
    else:
        cnt=0
        cntA=Counter(A)
        for x in cntA.values:
            cnt=max(cnt,cntA[x])
        if cnt>n:
            print("Alice")
        else:
            print("Bob")

0