結果

問題 No.1716 Bonus Nim
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-10-23 13:01:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 683 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 146,704 KB
最終ジャッジ日時 2023-10-25 08:55:12
合計ジャッジ時間 7,776 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,236 KB
testcase_01 AC 42 ms
53,300 KB
testcase_02 AC 40 ms
53,264 KB
testcase_03 AC 41 ms
53,272 KB
testcase_04 AC 216 ms
118,772 KB
testcase_05 AC 237 ms
129,652 KB
testcase_06 AC 201 ms
135,496 KB
testcase_07 AC 215 ms
132,212 KB
testcase_08 AC 223 ms
132,172 KB
testcase_09 AC 165 ms
127,656 KB
testcase_10 AC 262 ms
141,624 KB
testcase_11 AC 255 ms
134,036 KB
testcase_12 AC 221 ms
128,372 KB
testcase_13 AC 297 ms
146,164 KB
testcase_14 AC 259 ms
134,780 KB
testcase_15 AC 683 ms
78,516 KB
testcase_16 AC 42 ms
53,332 KB
testcase_17 AC 42 ms
55,380 KB
testcase_18 AC 43 ms
53,400 KB
testcase_19 AC 42 ms
55,380 KB
testcase_20 AC 43 ms
55,380 KB
testcase_21 AC 42 ms
55,380 KB
testcase_22 AC 261 ms
142,872 KB
testcase_23 AC 150 ms
119,532 KB
testcase_24 AC 214 ms
146,704 KB
testcase_25 AC 197 ms
138,048 KB
testcase_26 AC 235 ms
132,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0