121142024-12-02 15:43:40KissCsongor777Inverziócpp11Time limit exceeded 10/50600ms2356 KiB
#include <iostream>

using namespace std;
int H[500001];
int main()
{
    int N,m=-210000000,a,b;
    cin>>N;

    for(int i=1; i<=N; i++)cin>>H[i];
    for(int i=1; i<=N; i++)
    {
        for(int j=N; j>i; j--)
        {
            if(H[i]>H[j] && j-i>m)
                {
                    m=j-i;
                    a=i;
                    b=j;
                }
        }
    }
    if(m==-210000000)cout<<-1;
    else cout<<a<<" "<<b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base10/50
1Accepted0/01ms320 KiB
2Time limit exceeded0/0578ms576 KiB
3Accepted1/11ms320 KiB
4Accepted2/24ms508 KiB
5Accepted7/72ms508 KiB
6Time limit exceeded0/2600ms568 KiB
7Time limit exceeded0/2598ms2320 KiB
8Time limit exceeded0/2600ms2108 KiB
9Time limit exceeded0/2587ms2356 KiB
10Time limit exceeded0/2600ms2268 KiB
11Time limit exceeded0/2600ms2152 KiB
12Time limit exceeded0/2600ms2104 KiB
13Time limit exceeded0/2588ms2352 KiB
14Time limit exceeded0/2600ms2268 KiB
15Time limit exceeded0/2600ms2344 KiB
16Time limit exceeded0/2600ms2188 KiB
17Time limit exceeded0/2584ms2104 KiB
18Time limit exceeded0/2600ms2104 KiB
19Time limit exceeded0/3600ms2100 KiB
20Time limit exceeded0/3600ms2256 KiB
21Time limit exceeded0/2587ms2104 KiB
22Time limit exceeded0/2600ms2276 KiB
23Time limit exceeded0/2600ms2328 KiB
24Time limit exceeded0/2600ms2100 KiB