結果

問題 No.2126 MEX Game
ユーザー ニックネームニックネーム
提出日時 2022-11-18 22:00:24
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 11,816 KB
実行使用メモリ 21,620 KB
最終ジャッジ日時 2023-10-20 06:50:17
合計ジャッジ時間 2,581 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,736 KB
testcase_01 AC 30 ms
10,736 KB
testcase_02 AC 30 ms
10,736 KB
testcase_03 AC 32 ms
10,736 KB
testcase_04 AC 31 ms
10,736 KB
testcase_05 AC 30 ms
10,736 KB
testcase_06 AC 30 ms
10,736 KB
testcase_07 AC 30 ms
10,736 KB
testcase_08 AC 30 ms
10,736 KB
testcase_09 AC 30 ms
10,736 KB
testcase_10 AC 82 ms
21,620 KB
testcase_11 AC 84 ms
21,620 KB
testcase_12 AC 80 ms
21,620 KB
testcase_13 AC 81 ms
21,620 KB
testcase_14 AC 76 ms
21,608 KB
testcase_15 AC 73 ms
21,608 KB
testcase_16 AC 74 ms
21,476 KB
testcase_17 AC 73 ms
20,924 KB
testcase_18 AC 74 ms
21,348 KB
testcase_19 AC 60 ms
11,900 KB
testcase_20 AC 59 ms
11,900 KB
testcase_21 AC 75 ms
21,608 KB
testcase_22 AC 31 ms
10,736 KB
testcase_23 AC 31 ms
10,736 KB
testcase_24 AC 30 ms
10,736 KB
testcase_25 AC 30 ms
10,736 KB
testcase_26 AC 31 ms
10,736 KB
testcase_27 AC 30 ms
10,736 KB
testcase_28 AC 30 ms
10,736 KB
testcase_29 AC 31 ms
10,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m = max(a)
b = [0]*100001
for v in a: b[v] += 1
f = g = False
for i, v in enumerate(b):
    if v == 0:
        if f and not g and i > m: print(i-1); break
        else: print(i); break
    if v == 1:
        if f: print(i); break
        else: f = True
    if v > 2: g = True
0