13632022-05-23 11:15:33nkdorka1212Késéscpp11Accepted 50/50163ms36832 KiB
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define accept_plss ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long
#define pb push_back

signed main()
{
    accept_plss;
    int n;
    cin>>n;
    set<int>s;
    vector<int>v(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>v[i];
    }
    int kezd=INT_MAX/2;
    for(int i=n;i>=1;i--)
    {
        if(s.find(v[i])==s.end())
        {
            s.insert(v[i]);
            kezd=i;
        }
    }
    cout<<kezd<<"\n";

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1768 KiB
2Accepted0/08ms2848 KiB
3Accepted5/52ms1992 KiB
4Accepted5/51ms1992 KiB
5Accepted5/532ms5644 KiB
6Accepted5/532ms6420 KiB
7Accepted4/4120ms19632 KiB
8Accepted4/4127ms20504 KiB
9Accepted4/4114ms20232 KiB
10Accepted4/4112ms20324 KiB
11Accepted4/4109ms20156 KiB
12Accepted2/2119ms22652 KiB
13Accepted2/2162ms33580 KiB
14Accepted1/1158ms35372 KiB
15Accepted1/1163ms36832 KiB
16Accepted1/1143ms35708 KiB
17Accepted1/1120ms33424 KiB
18Accepted1/159ms27456 KiB
19Accepted1/150ms28896 KiB