121132024-12-02 15:42:55mártonágnesInverziócpp11Time limit exceeded 8/50600ms2468 KiB
#include <iostream>

using namespace std;

int main()
{
    int N, maxi=0, hosz, a, b;
    cin >> N;
    int S[N-1];
    for (int i=1; i<=N; i++)
    {
        cin >> S[i];
    }
    for (int i=1; i<=N; i++)
    {
        for (int j=i+1; j<=N; j++)
        {
            if (S[i]>S[j]) hosz=j-i;
            if (hosz>maxi)
            {
                a=i;
                b=j;
                maxi=hosz;
            }
        }
    }
    if (maxi==0) cout << -1;
    else cout << a << " " << b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base8/50
1Accepted0/01ms320 KiB
2Time limit exceeded0/0587ms516 KiB
3Accepted1/11ms320 KiB
4Wrong answer0/23ms508 KiB
5Accepted7/72ms372 KiB
6Time limit exceeded0/2600ms564 KiB
7Time limit exceeded0/2598ms2232 KiB
8Time limit exceeded0/2600ms2104 KiB
9Time limit exceeded0/2578ms2356 KiB
10Time limit exceeded0/2600ms2296 KiB
11Time limit exceeded0/2600ms2316 KiB
12Time limit exceeded0/2600ms2468 KiB
13Time limit exceeded0/2579ms2104 KiB
14Time limit exceeded0/2600ms2256 KiB
15Time limit exceeded0/2600ms2192 KiB
16Time limit exceeded0/2577ms2108 KiB
17Time limit exceeded0/2589ms2104 KiB
18Time limit exceeded0/2600ms2332 KiB
19Time limit exceeded0/3600ms2220 KiB
20Time limit exceeded0/3600ms2104 KiB
21Time limit exceeded0/2580ms2104 KiB
22Time limit exceeded0/2600ms2104 KiB
23Time limit exceeded0/2600ms2280 KiB
24Time limit exceeded0/2600ms2144 KiB