結果
| 問題 | 
                            No.2126 MEX Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             gew1fw
                         | 
                    
| 提出日時 | 2025-06-12 12:48:48 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 246 bytes | 
| コンパイル時間 | 184 ms | 
| コンパイル使用メモリ | 82,660 KB | 
| 実行使用メモリ | 100,532 KB | 
| 最終ジャッジ日時 | 2025-06-12 12:49:06 | 
| 合計ジャッジ時間 | 3,182 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 12 | 
ソースコード
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
count = defaultdict(int)
for num in a:
    count[num] += 1
mex = 0
while True:
    if count[mex] >= 2:
        mex += 1
    else:
        break
print(mex)
            
            
            
        
            
gew1fw