結果

問題 No.2126 MEX Game
ユーザー gew1fw
提出日時 2025-06-12 14:53:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 82,796 KB
実行使用メモリ 99,344 KB
最終ジャッジ日時 2025-06-12 14:56:50
合計ジャッジ時間 3,364 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict

def main():
    input = sys.stdin.read().split()
    n = int(input[0])
    A = list(map(int, input[1:n+1]))
    
    count = defaultdict(int)
    for num in A:
        count[num] += 1
    
    m = 0
    while True:
        if count[m] >= m + 1:
            m += 1
        else:
            break
    print(m)

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