66322023-12-14 08:14:05Huni136Inverziócpp17Time limit exceeded 14/50574ms7152 KiB
#include <vector>
#include <iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<int> a(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>a.at(i);
    }
    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
base14/50
1Accepted0/03ms1812 KiB
2Accepted0/0232ms2316 KiB
3Accepted1/13ms2300 KiB
4Accepted2/23ms2332 KiB
5Accepted7/73ms2532 KiB
6Accepted2/2210ms2796 KiB
7Time limit exceeded0/2566ms4020 KiB
8Time limit exceeded0/2559ms4128 KiB
9Accepted2/2180ms7152 KiB
10Time limit exceeded0/2570ms4316 KiB
11Time limit exceeded0/2524ms4336 KiB
12Time limit exceeded0/2518ms4480 KiB
13Time limit exceeded0/2565ms4784 KiB
14Time limit exceeded0/2565ms4820 KiB
15Time limit exceeded0/2569ms4892 KiB
16Time limit exceeded0/2565ms4832 KiB
17Time limit exceeded0/2569ms4824 KiB
18Time limit exceeded0/2574ms4964 KiB
19Time limit exceeded0/3573ms4968 KiB
20Time limit exceeded0/3546ms4952 KiB
21Time limit exceeded0/2565ms5120 KiB
22Time limit exceeded0/2565ms5260 KiB
23Time limit exceeded0/2565ms5128 KiB
24Time limit exceeded0/2573ms5212 KiB