結果

問題 No.2126 MEX Game
コンテスト
ユーザー 👑 Kazun
提出日時 2022-11-18 21:55:39
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 347 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 362 ms
コンパイル使用メモリ 85,160 KB
実行使用メモリ 101,248 KB
最終ジャッジ日時 2026-04-08 14:47:39
合計ジャッジ時間 2,334 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def mex(S):
    x=0
    while x in S:
        x+=1
    return x

def solve():
    from collections import Counter

    N=int(input())
    A=list(map(int,input().split()))
    CA=Counter(A)

    S=set()
    for a in CA:
        if CA[a]>=2:
            S.add(a)
    return mex(S)

#==================================================
print(solve())
0