16542022-12-01 12:32:10bzsofiaInverziócpp11Time limit exceeded 12/50600ms4936 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int i, n, a, tav, tavi, tavj, j;

int main()
{
    cin>>n;

    vector <int> x(n+1);

    for (i=1; i<=n; ++i)
    {
        cin>>x[i];
    }

    tav=0;

    for (i=1; i<n; ++i)
    {
        j=i+tav+1;
        while (j<=n)
        {
            if (x[i]>x[j] && tav<j-i)
            {
                tav=j-i;
                tavi=i;
                tavj=j;
            }
            ++j;
        }
    }

    if (tav==0) cout<<-1;
    else cout<<tavi<<" "<<tavj;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/50
1Accepted0/03ms1816 KiB
2Time limit exceeded0/0600ms1672 KiB
3Accepted1/12ms2220 KiB
4Accepted2/22ms2292 KiB
5Accepted7/73ms2540 KiB
6Accepted2/2416ms3088 KiB
7Time limit exceeded0/2555ms4040 KiB
8Time limit exceeded0/2532ms4360 KiB
9Time limit exceeded0/2550ms4528 KiB
10Time limit exceeded0/2563ms4136 KiB
11Time limit exceeded0/2574ms4480 KiB
12Time limit exceeded0/2561ms4308 KiB
13Time limit exceeded0/2578ms4612 KiB
14Time limit exceeded0/2577ms4684 KiB
15Time limit exceeded0/2558ms4644 KiB
16Time limit exceeded0/2546ms4588 KiB
17Time limit exceeded0/2573ms4576 KiB
18Time limit exceeded0/2569ms4648 KiB
19Time limit exceeded0/3558ms4904 KiB
20Time limit exceeded0/3577ms4832 KiB
21Time limit exceeded0/2546ms4788 KiB
22Time limit exceeded0/2561ms4796 KiB
23Time limit exceeded0/2574ms4872 KiB
24Time limit exceeded0/2577ms4936 KiB