結果

問題 No.2126 MEX Game
ユーザー roaris
提出日時 2022-11-18 23:18:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,200 KB
実行使用メモリ 99,272 KB
最終ジャッジ日時 2024-09-20 03:48:47
合計ジャッジ時間 2,656 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 5
権限があれば一括ダウンロードができます

ソースコード

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