結果

問題 No.1716 Bonus Nim
コンテスト
ユーザー puzneko
提出日時 2021-11-15 23:17:59
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 194 ms / 2,000 ms
コード長 599 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 339 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 265,332 KB
最終ジャッジ日時 2026-05-25 21:03:55
合計ジャッジ時間 5,365 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from sys import stdin

t, *indata = map(int, stdin.read().split())
offset = 0
for _ in range(t):
    n = indata[offset]
    offset += 1
    if n % 2 == 1:
        print("Alice")
        offset += n
        continue
    d = dict()
    appear = set()
    for i in range(n):
        a = indata[offset+i]
        if a in appear:
            d[a] += 1
        else:
            d[a] = 1
            appear.add(a)
    offset += n
    check = True
    for i in appear:
        if d[i] % 2 == 1:
            check = False
            break
    if check:
        print("Bob")
    else:
        print("Alice")
0