結果

問題 No.2126 MEX Game
ユーザー lloyz
提出日時 2022-11-18 22:21:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 379 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,256 KB
最終ジャッジ日時 2024-09-20 02:44:16
合計ジャッジ時間 2,444 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
counter = Counter(A)

for i in range(n):
    if counter[i] >= 2:
        continue
    if counter[i] == 1:
        add = 0
        for j in range(i + 1, n):
            if counter[j] > 0:
                add = 1
                break
        print(i + add)
        break
    print(i)
    break
0