結果

問題 No.2126 MEX Game
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2023-01-19 09:58:21
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 107,112 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 23:15:49
合計ジャッジ時間 2,271 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;

int main(){

    int N, A, ans=0;
    cin >> N;
    vector<int> cnt(100001);

    for (int i=0; i<N; i++){
        cin >> A;
        cnt[A]++;
    }

    for (int i=0; i<=100000; i++){
        if (cnt[i] >= 2) ans++;
        else break;
    }

    cout << ans << endl;

    return 0;
}
0