結果

問題 No.1716 Bonus Nim
ユーザー zkou
提出日時 2021-09-25 12:00:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 751 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 150,240 KB
最終ジャッジ日時 2024-09-23 03:49:29
合計ジャッジ時間 6,387 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

T = int(input())
for _ in range(T):
    N = int(input())
    As = list(map(int, input().split()))
    if N % 2 == 1:
        print("Alice")
    else:
        nim = 0
        cnter = Counter(As)
        odd = False
        for val in cnter.values():
            if val % 2:
                odd = True
                break
        if odd:
            print("Alice")
        else:
            print("Bob")
0