結果

問題 No.1716 Bonus Nim
ユーザー tassei903
提出日時 2021-10-25 09:09:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 151,572 KB
最終ジャッジ日時 2024-10-02 22:23:21
合計ジャッジ時間 5,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
t = ni()
from collections import deque,Counter

for _ in range(t):
    n = ni()
    a = na()
    if n%2:
        print("Alice")
        continue
    c = Counter([i for i in a])
    #print(c)
    b = 1
    for j in c:
        if c[j]%2:
            print("Alice")
            b = 0
            break
    if b:
        print("Bob")
0