36042023-03-01 09:58:33AblablablaInverziócpp17Time limit exceeded 10/50600ms5576 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> szamok(n, 0);
    for(int i = 0; i < n; i++){
        cin >> szamok[i];
    }

    int maxi = 0;
    int indk = -1;
    int indn = -1;
    for(int i = 0; i < n; i++){
        /*if(maxi > n - i - 1){
            break;
        }*/
        for(int j = n - 1; j > i; j--){
                //cout << i << " " << j << "\n";
            if(j - i > maxi && szamok[i] > szamok[j]){
                maxi = j - i;
                indk = i + 1;
                indn = j + 1;
                //cout << indk << " " << indn << " " << maxi << "\n";
                break;
            }
        }
    }

    if(indn == -1 && indk == -1){
        cout << "-1";
    } else{
        cout << indk << " " << indn;
    }
}
SubtaskSumTestVerdictTimeMemory
base10/50
1Accepted0/03ms1808 KiB
2Time limit exceeded0/0550ms1600 KiB
3Accepted1/13ms2268 KiB
4Accepted2/23ms2328 KiB
5Accepted7/73ms2536 KiB
6Time limit exceeded0/2600ms2224 KiB
7Time limit exceeded0/2578ms4124 KiB
8Time limit exceeded0/2551ms4004 KiB
9Time limit exceeded0/2549ms3888 KiB
10Time limit exceeded0/2544ms4144 KiB
11Time limit exceeded0/2560ms4356 KiB
12Time limit exceeded0/2568ms4524 KiB
13Time limit exceeded0/2573ms4808 KiB
14Time limit exceeded0/2577ms4700 KiB
15Time limit exceeded0/2528ms4836 KiB
16Time limit exceeded0/2577ms4924 KiB
17Time limit exceeded0/2555ms5200 KiB
18Time limit exceeded0/2564ms5424 KiB
19Time limit exceeded0/3573ms5432 KiB
20Time limit exceeded0/3573ms5264 KiB
21Time limit exceeded0/2541ms5236 KiB
22Time limit exceeded0/2560ms5476 KiB
23Time limit exceeded0/2580ms5504 KiB
24Time limit exceeded0/2560ms5576 KiB