66332023-12-14 08:17:41Huni136Inverziócpp17Runtime error 0/506ms4540 KiB
#include <vector>
#include <iostream>
using namespace std;

int main()
{
    int n,x;
    cin>>n;
   vector<int> a;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        a.at(i)=x;
    }
    int db;
   // bool megvan=false;
    for(int i=1;i<=n;i++)
    {
        db=a.at(i)-1;
        int j=n;
        while (j>i && db!=0)
        {
            if(a[i]>a[j])
            {
                cout<<i<<" "<<j;
                return 0;
            }
            else
            {
                db--;
            }
            j--;
        }
    }
    cout<<-1;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Runtime error0/04ms2220 KiB
2Runtime error0/04ms2548 KiB
3Runtime error0/14ms2756 KiB
4Runtime error0/24ms2968 KiB
5Runtime error0/74ms3292 KiB
6Runtime error0/24ms3252 KiB
7Runtime error0/24ms3248 KiB
8Runtime error0/24ms3328 KiB
9Runtime error0/26ms3660 KiB
10Runtime error0/24ms3720 KiB
11Runtime error0/24ms3936 KiB
12Runtime error0/24ms4164 KiB
13Runtime error0/24ms4128 KiB
14Runtime error0/24ms4180 KiB
15Runtime error0/24ms4016 KiB
16Runtime error0/24ms4076 KiB
17Runtime error0/24ms4156 KiB
18Runtime error0/24ms4232 KiB
19Runtime error0/34ms4428 KiB
20Runtime error0/34ms4268 KiB
21Runtime error0/24ms4192 KiB
22Runtime error0/24ms4456 KiB
23Runtime error0/24ms4540 KiB
24Runtime error0/24ms4480 KiB