66342023-12-14 08:20:05Huni136Inverziócpp17Wrong answer 1/50600ms7472 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.emplace_back(x);
    }
    int db;
   // bool megvan=false;
    for(int i=0;i<n;i++)
    {
        db=a.at(i)-1;
        int j=n-1;
        while (j>i && db!=0)
        {
            if(a[i]>a[j])
            {
                cout<<i<<" "<<j;
                return 0;
            }
            else
            {
                db--;
            }
            j--;
        }
    }
    cout<<-1;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base1/50
1Wrong answer0/03ms1692 KiB
2Wrong answer0/0270ms2612 KiB
3Accepted1/13ms2068 KiB
4Wrong answer0/23ms2156 KiB
5Wrong answer0/73ms2288 KiB
6Wrong answer0/2244ms3136 KiB
7Time limit exceeded0/2573ms4212 KiB
8Time limit exceeded0/2558ms4540 KiB
9Wrong answer0/2185ms7472 KiB
10Time limit exceeded0/2569ms4704 KiB
11Time limit exceeded0/2569ms4708 KiB
12Time limit exceeded0/2550ms4652 KiB
13Time limit exceeded0/2578ms4656 KiB
14Time limit exceeded0/2558ms4732 KiB
15Time limit exceeded0/2600ms4624 KiB
16Time limit exceeded0/2578ms4800 KiB
17Time limit exceeded0/2552ms4916 KiB
18Time limit exceeded0/2569ms4968 KiB
19Time limit exceeded0/3565ms5132 KiB
20Time limit exceeded0/3546ms5200 KiB
21Time limit exceeded0/2565ms5164 KiB
22Time limit exceeded0/2574ms5192 KiB
23Time limit exceeded0/2537ms5120 KiB
24Time limit exceeded0/2587ms5268 KiB