結果

問題 No.2126 MEX Game
ユーザー lam6er
提出日時 2025-03-31 17:29:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 104,052 KB
最終ジャッジ日時 2025-03-31 17:30:24
合計ジャッジ時間 2,832 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict

def main():
    n, *rest = map(int, sys.stdin.read().split())
    a = rest[:n]
    freq = defaultdict(int)
    for num in a:
        freq[num] += 1
    x = 0
    while True:
        if x not in freq or freq[x] <= 1:
            print(x)
            return
        x += 1

if __name__ == "__main__":
    main()
0