121102024-12-02 15:35:39mártonágnesInverziócpp11Wrong answer 1/50600ms2332 KiB
#include <iostream>

using namespace std;

int main()
{
    int N, maxi=0, hosz, a, b;
    cin >> N;
    int S[N-1];
    for (int i=0; i<=N-1; i++)
    {
        cin >> S[i];
    }
    for (int i=0; i<=N-1; i++)
    {
        for (int j=i+1; j<=N-1; 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
base1/50
1Wrong answer0/01ms320 KiB
2Time limit exceeded0/0577ms568 KiB
3Accepted1/11ms320 KiB
4Wrong answer0/23ms320 KiB
5Wrong answer0/72ms360 KiB
6Time limit exceeded0/2600ms568 KiB
7Time limit exceeded0/2600ms2224 KiB
8Time limit exceeded0/2600ms2216 KiB
9Time limit exceeded0/2583ms2104 KiB
10Time limit exceeded0/2598ms2320 KiB
11Time limit exceeded0/2600ms2112 KiB
12Time limit exceeded0/2600ms2104 KiB
13Time limit exceeded0/2583ms2104 KiB
14Time limit exceeded0/2584ms2104 KiB
15Time limit exceeded0/2587ms2096 KiB
16Time limit exceeded0/2600ms2208 KiB
17Time limit exceeded0/2587ms2104 KiB
18Time limit exceeded0/2578ms2100 KiB
19Time limit exceeded0/3578ms2104 KiB
20Time limit exceeded0/3600ms2148 KiB
21Time limit exceeded0/2584ms2104 KiB
22Time limit exceeded0/2582ms2104 KiB
23Time limit exceeded0/2582ms2104 KiB
24Time limit exceeded0/2598ms2332 KiB