67782023-12-19 09:40:42szabelrInverziócpp17Time limit exceeded 9/50600ms5528 KiB
#include <iostream>

using namespace std;

int main()
{
    int n,maxi=0,maxkez,maxveg,y=0;
    cin>>n;
    int tomb[n+1];
    for(int i=1; i<=n; i++)
    {
        cin>>tomb[i];
    }
    for(int i=1; i<n; i++)
    {
        y=i+1;
        while(y<=n)
        {
            if(tomb[y]<tomb[i]and (y-i+1)>maxi)
            {
                maxi = y-i+1;
                maxkez  = i;
                maxveg = y;
            }
            y++;
        }
    }
    cout<<maxkez<<" "<<maxveg;
    if(maxi==0)
        cout<<"-1";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/03ms1876 KiB
2Time limit exceeded0/0600ms1468 KiB
3Wrong answer0/13ms2180 KiB
4Accepted2/24ms2392 KiB
5Accepted7/73ms2496 KiB
6Time limit exceeded0/2568ms1784 KiB
7Time limit exceeded0/2578ms3800 KiB
8Time limit exceeded0/2564ms3876 KiB
9Time limit exceeded0/2574ms4168 KiB
10Time limit exceeded0/2559ms4368 KiB
11Time limit exceeded0/2565ms4520 KiB
12Time limit exceeded0/2550ms4540 KiB
13Time limit exceeded0/2570ms4792 KiB
14Time limit exceeded0/2561ms5020 KiB
15Time limit exceeded0/2574ms4944 KiB
16Time limit exceeded0/2561ms4892 KiB
17Time limit exceeded0/2577ms4892 KiB
18Time limit exceeded0/2578ms5240 KiB
19Time limit exceeded0/3574ms5280 KiB
20Time limit exceeded0/3564ms5324 KiB
21Time limit exceeded0/2580ms5320 KiB
22Time limit exceeded0/2569ms5328 KiB
23Time limit exceeded0/2565ms5528 KiB
24Time limit exceeded0/2554ms5440 KiB