結果

問題 No.2126 MEX Game
ユーザー roarisroaris
提出日時 2022-11-18 23:18:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 1,274 ms
コンパイル使用メモリ 81,300 KB
実行使用メモリ 97,260 KB
最終ジャッジ日時 2023-10-20 08:20:01
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,072 KB
testcase_01 AC 43 ms
53,072 KB
testcase_02 AC 43 ms
53,072 KB
testcase_03 AC 43 ms
53,072 KB
testcase_04 AC 43 ms
53,072 KB
testcase_05 AC 43 ms
53,072 KB
testcase_06 AC 43 ms
53,072 KB
testcase_07 WA -
testcase_08 AC 44 ms
53,072 KB
testcase_09 AC 42 ms
53,072 KB
testcase_10 AC 99 ms
92,392 KB
testcase_11 AC 86 ms
92,416 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 83 ms
93,872 KB
testcase_15 AC 83 ms
93,872 KB
testcase_16 AC 83 ms
93,832 KB
testcase_17 AC 74 ms
83,000 KB
testcase_18 AC 74 ms
83,076 KB
testcase_19 AC 66 ms
80,084 KB
testcase_20 AC 66 ms
80,084 KB
testcase_21 AC 84 ms
97,260 KB
testcase_22 AC 43 ms
53,092 KB
testcase_23 AC 43 ms
53,092 KB
testcase_24 AC 43 ms
53,092 KB
testcase_25 AC 42 ms
53,092 KB
testcase_26 WA -
testcase_27 AC 43 ms
53,092 KB
testcase_28 AC 43 ms
53,092 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

N = int(input())
A = list(map(int, input().split()))
cnt = Counter(A)
s = 0

for i in range(10**6):
    s += cnt[i]
    
    if cnt[i]>=2:
        continue
    else:
        if cnt[i]==0 or s==N:
            print(i)
        else:
            print(i+1)
            
        break
0