59242023-10-05 18:54:55mmatedKéséscpp17Time limit exceeded 10/50583ms36876 KiB
#include <bits/stdc++.h>
using namespace std;
#define f(i,k,n) for(int i=k; i<n; i++)
#define ll long long
const int inf = INT_MAX;

void solve()
{
    int n;
    cin>>n;
    vector<ll> a(n);
    set<ll> s;
    set<ll> x;
    int maxi=0;
    f(i,0,n)    
    {
        cin>>a[i];
        s.insert(a[i]);
    }
    f(i,1,n)
    {
        for(int j=i; j<n; j++)    x.insert(a[j]);
        if(x==s)    maxi=i;
        x={};
    }
    cout<<maxi+1;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--)  solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/50
1Accepted0/03ms1832 KiB
2Time limit exceeded0/0555ms2464 KiB
3Accepted5/557ms2656 KiB
4Accepted5/561ms3028 KiB
5Time limit exceeded0/5583ms4584 KiB
6Time limit exceeded0/5549ms5724 KiB
7Time limit exceeded0/4569ms18808 KiB
8Time limit exceeded0/4574ms20116 KiB
9Time limit exceeded0/4558ms19604 KiB
10Time limit exceeded0/4565ms19656 KiB
11Time limit exceeded0/4566ms19828 KiB
12Time limit exceeded0/2554ms22788 KiB
13Time limit exceeded0/2578ms33924 KiB
14Time limit exceeded0/1575ms35416 KiB
15Time limit exceeded0/1566ms36876 KiB
16Time limit exceeded0/1559ms35956 KiB
17Time limit exceeded0/1570ms33948 KiB
18Time limit exceeded0/1569ms27876 KiB
19Time limit exceeded0/1564ms29680 KiB