結果
| 問題 | No.1716 Bonus Nim |
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2021-10-23 13:01:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 486 ms / 2,000 ms |
| コード長 | 385 bytes |
| 記録 | |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 163,448 KB |
| 最終ジャッジ日時 | 2026-04-12 08:10:48 |
| 合計ジャッジ時間 | 5,153 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 26 |
ソースコード
from collections import defaultdict
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int,input().split()))
if n & 1:
print("Alice")
else:
d = defaultdict(int)
for i in range(n):
d[a[i]] += 1
ans = "Bob"
for k in d.keys():
if d[k] % 2 != 0:
ans = "Alice"
print(ans)
SidewaysOwl