結果

問題 No.1716 Bonus Nim
ユーザー tassei903tassei903
提出日時 2021-10-22 22:23:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 81,480 KB
実行使用メモリ 167,488 KB
最終ジャッジ日時 2023-10-24 13:39:42
合計ジャッジ時間 6,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,352 KB
testcase_01 WA -
testcase_02 AC 39 ms
55,352 KB
testcase_03 WA -
testcase_04 AC 240 ms
122,208 KB
testcase_05 WA -
testcase_06 AC 189 ms
117,552 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 163 ms
128,076 KB
testcase_10 AC 261 ms
136,000 KB
testcase_11 AC 262 ms
134,960 KB
testcase_12 AC 257 ms
135,320 KB
testcase_13 AC 307 ms
161,424 KB
testcase_14 WA -
testcase_15 AC 325 ms
79,444 KB
testcase_16 AC 39 ms
55,360 KB
testcase_17 AC 39 ms
55,360 KB
testcase_18 AC 39 ms
55,360 KB
testcase_19 AC 40 ms
55,360 KB
testcase_20 AC 39 ms
55,360 KB
testcase_21 AC 40 ms
55,360 KB
testcase_22 WA -
testcase_23 AC 141 ms
119,124 KB
testcase_24 AC 220 ms
126,276 KB
testcase_25 AC 211 ms
144,100 KB
testcase_26 AC 276 ms
166,208 KB
権限があれば一括ダウンロードができます

ソースコード

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])
    p = sum([1 for i in c if c[i]==1])
    q = sum([c[i]-1 for i in c if c[i]>=2])
    r = len([c[i]-1 for i in c if c[i]>=2])
    z = max(n//2-1-p-r,0)
    if q-z<=n//2-1:
        print("Alice")
    else:
        print("Bob")
0