249592026-02-17 09:38:32Kornel2025Legcsalódottabb versenyző (75 pont)cpp17Wrong answer 40/7543ms5884 KiB
#include <bits/stdc++.h>
using namespace std;
main()
{
    int n, maxi=0, maxh=0;
    cin >> n;
    vector<vector<int>> v(n, vector<int>(2));
    for(int i=0; i<n; i++)
    {
        cin >> v[i][0];
        if(v[i][0]>=maxi)
        {
            maxi=v[i][0];
            v[i][1]=1;
            maxh=i;
        }
    }
    maxi=0;
    int maxh2=-1;
    for(int i=maxh-1; i>=0 ; i--)
    {
        if(v[i][1]==1)
        {
            if(maxh-i>=maxi) maxh2=i+1;
            maxi=max(maxi, maxh-i);
            maxh=i;
        }
    }
    cout << maxh2;
}
SubtaskSumTestVerdictTimeMemory
base40/75
1Accepted0/01ms316 KiB
2Wrong answer0/043ms5692 KiB
3Wrong answer0/51ms508 KiB
4Accepted5/52ms316 KiB
5Accepted5/51ms316 KiB
6Accepted5/51ms316 KiB
7Accepted5/51ms324 KiB
8Accepted5/51ms416 KiB
9Wrong answer0/51ms316 KiB
10Accepted5/51ms316 KiB
11Accepted5/51ms500 KiB
12Wrong answer0/51ms316 KiB
13Wrong answer0/543ms5684 KiB
14Wrong answer0/541ms5684 KiB
15Accepted5/541ms5884 KiB
16Wrong answer0/543ms5660 KiB
17Wrong answer0/543ms5684 KiB