82212024-01-12 21:34:27hackemonKéséscpp17Accepted 50/50273ms21796 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    
    map<int,int> idopont;
    vector<int> egesz;
    for(int i = 1;i <= n;i++ ) {
        int a;
        cin >> a;
        egesz.push_back(a);
        idopont[a] = i;
    }
    int ans = n + 1;
    for(int i = 0;i < n;i++ ) {
        ans = min(ans, idopont[egesz[i]]);
    }
    cout << ans << endl;
    
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1848 KiB
2Accepted0/016ms2952 KiB
3Accepted5/53ms2248 KiB
4Accepted5/53ms2608 KiB
5Accepted5/590ms4704 KiB
6Accepted5/592ms4892 KiB
7Accepted4/4230ms16360 KiB
8Accepted4/4217ms15880 KiB
9Accepted4/4209ms14376 KiB
10Accepted4/4199ms13324 KiB
11Accepted4/4194ms12464 KiB
12Accepted2/2224ms12932 KiB
13Accepted2/2256ms21796 KiB
14Accepted1/1256ms21548 KiB
15Accepted1/1273ms21232 KiB
16Accepted1/1266ms18216 KiB
17Accepted1/1243ms14512 KiB
18Accepted1/1166ms6448 KiB
19Accepted1/1158ms6140 KiB