結果
| 問題 | No.1716 Bonus Nim | 
| コンテスト | |
| ユーザー |  puzneko | 
| 提出日時 | 2021-11-15 23:17:59 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 279 ms / 2,000 ms | 
| コード長 | 599 bytes | 
| コンパイル時間 | 401 ms | 
| コンパイル使用メモリ | 82,140 KB | 
| 実行使用メモリ | 239,276 KB | 
| 最終ジャッジ日時 | 2024-12-15 08:00:51 | 
| 合計ジャッジ時間 | 6,219 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 26 | 
ソースコード
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")
            
            
            
        