141912025-01-10 08:40:41feheristvanKéséscpp17Runtime error 0/504ms1516 KiB
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n;
    vector <int> v;
    cin >> n;
    v.resize(n);
    vector <long> elof;
    elof.resize(100000000000);
    for(int i = 0 ; i < n; i ++){
        cin >> v[i];
        elof[v[i]] ++;
    }
    bool b;
    int i = 0, j, db = 1;
    while(i < n){
        b = 0;
        j = i + 1;
        if(elof[v[i]] > 1){
            while(j < n and !b){
                if(v[i] == v[j])
                    b = 1;
                j ++;
            }
        }
        else{
            break;
        }
        db ++;
        i ++;
    }
    cout << db;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/04ms564 KiB
2Runtime error0/04ms564 KiB
3Runtime error0/54ms316 KiB
4Runtime error0/54ms564 KiB
5Runtime error0/54ms1076 KiB
6Runtime error0/54ms1268 KiB
7Runtime error0/44ms1320 KiB
8Runtime error0/44ms1076 KiB
9Runtime error0/44ms1332 KiB
10Runtime error0/44ms1332 KiB
11Runtime error0/44ms1516 KiB
12Runtime error0/24ms1076 KiB
13Runtime error0/24ms1076 KiB
14Runtime error0/14ms1332 KiB
15Runtime error0/14ms1332 KiB
16Runtime error0/14ms1076 KiB
17Runtime error0/14ms1076 KiB
18Runtime error0/14ms1076 KiB
19Runtime error0/14ms1160 KiB