結果
| 問題 |
No.1716 Bonus Nim
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-10-22 23:55:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 664 bytes |
| コンパイル時間 | 325 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 147,404 KB |
| 最終ジャッジ日時 | 2024-09-24 07:17:17 |
| 合計ジャッジ時間 | 6,411 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 WA * 19 |
ソースコード
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:
cnt=max(cnt,cntA[x])
if cnt>n//2:
print("Alice")
else:
print("Bob")