結果

問題 No.1716 Bonus Nim
ユーザー noetherian_ringnoetherian_ring
提出日時 2021-10-22 22:43:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 625 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 148,672 KB
最終ジャッジ日時 2023-10-24 14:05:01
合計ジャッジ時間 5,766 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
55,292 KB
testcase_01 AC 38 ms
55,292 KB
testcase_02 AC 38 ms
55,292 KB
testcase_03 AC 38 ms
55,292 KB
testcase_04 AC 195 ms
124,984 KB
testcase_05 AC 199 ms
126,236 KB
testcase_06 AC 163 ms
131,204 KB
testcase_07 AC 169 ms
128,664 KB
testcase_08 AC 183 ms
126,968 KB
testcase_09 AC 145 ms
125,164 KB
testcase_10 AC 200 ms
144,116 KB
testcase_11 AC 195 ms
126,020 KB
testcase_12 AC 191 ms
126,300 KB
testcase_13 AC 208 ms
144,612 KB
testcase_14 AC 192 ms
125,164 KB
testcase_15 AC 227 ms
77,472 KB
testcase_16 AC 39 ms
55,472 KB
testcase_17 AC 38 ms
55,472 KB
testcase_18 AC 39 ms
55,472 KB
testcase_19 AC 38 ms
55,472 KB
testcase_20 AC 38 ms
55,472 KB
testcase_21 AC 38 ms
55,472 KB
testcase_22 AC 198 ms
143,892 KB
testcase_23 AC 129 ms
116,808 KB
testcase_24 AC 177 ms
148,672 KB
testcase_25 AC 163 ms
136,512 KB
testcase_26 AC 187 ms
139,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import os

sys.setrecursionlimit(100000)
is_local = "TERM_PROGRAM" in os.environ
input = sys.stdin.readline
INF = float('inf')
MOD = 998244353

def debug(*args, **kwargs):
    if is_local:
        print(*args, **kwargs)
def I(): return input().rstrip()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return map(int, input().split())
def LIIS(): return list(map(int, input().split()))

def main():
    q = II()
    from collections import Counter

    for _ in range(q):
        n = II()
        va = LIIS()
        if len(va) % 2:
            print("Alice")
            continue

        cnt = Counter(va)
        if all(v % 2 == 0 for v in cnt.values()):
            print("Bob")
        else:
            print("Alice")

if __name__ == "__main__":
    main()
0