121152024-12-02 16:02:31mártonágnesInverziócpp11Wrong answer 3/501ms512 KiB
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int N, maxi=0, hosz, a, b,j;
    ifstream fin("be2.txt");
    fin >> N;
    int S[N-1];
    for (int i=1; i<=N; i++)
    {
        fin >> S[i];
    }
    for (int i=1; i<=N; i++)
    {
        ///for (int j=i+1; j<=N; j++)
        j=N;
        while (j>i)
        {
            if (S[i]>S[j]) hosz=j-i;
            if (hosz>maxi)
            {
                a=i;
                b=j;
                maxi=hosz;
            }
            j--;
        }
    }
    if (maxi==0) cout << -1;
    else cout << a << " " << b;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Wrong answer0/01ms320 KiB
2Wrong answer0/01ms320 KiB
3Accepted1/11ms320 KiB
4Wrong answer0/21ms508 KiB
5Wrong answer0/71ms320 KiB
6Wrong answer0/21ms320 KiB
7Wrong answer0/21ms320 KiB
8Wrong answer0/21ms320 KiB
9Wrong answer0/21ms320 KiB
10Wrong answer0/21ms320 KiB
11Wrong answer0/21ms512 KiB
12Wrong answer0/21ms320 KiB
13Wrong answer0/21ms332 KiB
14Wrong answer0/21ms320 KiB
15Wrong answer0/21ms500 KiB
16Wrong answer0/21ms320 KiB
17Wrong answer0/21ms320 KiB
18Wrong answer0/21ms320 KiB
19Wrong answer0/31ms508 KiB
20Wrong answer0/31ms320 KiB
21Wrong answer0/21ms320 KiB
22Wrong answer0/21ms320 KiB
23Wrong answer0/21ms320 KiB
24Accepted2/21ms320 KiB