結果

問題 No.2126 MEX Game
ユーザー 👑 rin204rin204
提出日時 2022-11-18 21:29:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,644 KB
実行使用メモリ 83,228 KB
最終ジャッジ日時 2023-10-20 06:16:54
合計ジャッジ時間 3,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
54,096 KB
testcase_01 AC 39 ms
54,096 KB
testcase_02 AC 40 ms
54,096 KB
testcase_03 AC 40 ms
54,096 KB
testcase_04 AC 40 ms
54,096 KB
testcase_05 AC 40 ms
54,096 KB
testcase_06 AC 39 ms
54,096 KB
testcase_07 WA -
testcase_08 AC 40 ms
54,096 KB
testcase_09 AC 40 ms
54,096 KB
testcase_10 AC 84 ms
83,096 KB
testcase_11 AC 82 ms
83,096 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 80 ms
83,056 KB
testcase_15 AC 80 ms
81,008 KB
testcase_16 AC 80 ms
80,944 KB
testcase_17 AC 80 ms
82,648 KB
testcase_18 AC 81 ms
82,784 KB
testcase_19 AC 60 ms
79,212 KB
testcase_20 AC 60 ms
79,212 KB
testcase_21 AC 80 ms
83,056 KB
testcase_22 AC 39 ms
54,096 KB
testcase_23 AC 41 ms
54,096 KB
testcase_24 AC 40 ms
54,096 KB
testcase_25 AC 39 ms
54,096 KB
testcase_26 WA -
testcase_27 AC 40 ms
54,096 KB
testcase_28 AC 40 ms
54,096 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
A.sort()
cnt = [0] * (10 ** 5 + 1)
for a in A:
    cnt[a] += 1

tot = 0
for i in range(10 ** 5):
    tot += cnt[i]
    if cnt[i] == 0:
        print(i)
        break
    elif cnt[i] == 1:
        if tot == n:
            print(i)
        else:
            print(i + 1)
        break
0