結果

問題 No.1716 Bonus Nim
ユーザー puznekopuzneko
提出日時 2021-11-15 23:13:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 600 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 67,356 KB
最終ジャッジ日時 2024-05-08 23:58:36
合計ジャッジ時間 11,372 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 534 ms
29,516 KB
testcase_16 AC 30 ms
10,752 KB
testcase_17 AC 29 ms
10,624 KB
testcase_18 AC 29 ms
10,752 KB
testcase_19 AC 28 ms
10,624 KB
testcase_20 AC 30 ms
10,752 KB
testcase_21 AC 29 ms
10,752 KB
testcase_22 WA -
testcase_23 AC 207 ms
65,428 KB
testcase_24 WA -
testcase_25 AC 320 ms
65,556 KB
testcase_26 AC 454 ms
67,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

t, *indata = map(int, stdin.read().split())
offset = 0
for _ in range(t):
    n = indata[offset]
    offset += 1
    if n % 2 == 1:
        print("Alice")
        offset += n
        continue
    d = dict()
    appear = set()
    for i in range(n):
        a = indata[offset+i]
        if a in appear:
            d[a] += 1
        else:
            d[a] = 1
            appear.add(a)
    offset += n
    check = True
    for i in appear:
        if d[a] % 2 == 1:
            check = False
            break
    if check:
        print("Bob")
    else:
        print("Alice")
0