60092023-10-18 16:24:56Tina0731Inverziócpp14Time limit exceeded 14/50600ms7224 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int t[n+1];
    for(int i=1;i<=n;i++)
    cin>>t[i];

    int h=n;
    int jobb, bal;
    while(h>1)
    {
        jobb=h;
        bal=1;
        if(t[bal]>t[jobb])
        {
            cout<<bal<<" "<<jobb;
            return 0;
        }
        while(jobb<n)
        {
            //cout<<"xx";
            bal++;
            jobb++;
            if(t[bal]>t[jobb])
            {
                cout<<bal<<" "<<jobb;
                return 0;
            }
        }

        h--;
    }
    cout<<-1;


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/03ms1872 KiB
2Time limit exceeded0/0600ms1472 KiB
3Accepted1/13ms2384 KiB
4Accepted2/23ms2528 KiB
5Accepted7/73ms2732 KiB
6Accepted2/2307ms3400 KiB
7Time limit exceeded0/2574ms4292 KiB
8Time limit exceeded0/2558ms4508 KiB
9Accepted2/2182ms7224 KiB
10Time limit exceeded0/2587ms4684 KiB
11Time limit exceeded0/2550ms4908 KiB
12Time limit exceeded0/2549ms4740 KiB
13Time limit exceeded0/2569ms4856 KiB
14Time limit exceeded0/2558ms4904 KiB
15Time limit exceeded0/2561ms5112 KiB
16Time limit exceeded0/2561ms5076 KiB
17Time limit exceeded0/2582ms5020 KiB
18Time limit exceeded0/2569ms5160 KiB
19Time limit exceeded0/3565ms5140 KiB
20Time limit exceeded0/3574ms5088 KiB
21Time limit exceeded0/2565ms5228 KiB
22Time limit exceeded0/2558ms5180 KiB
23Time limit exceeded0/2578ms5188 KiB
24Time limit exceeded0/2550ms5372 KiB