36052023-03-01 09:59:22AblablablaInverziócpp17Time limit exceeded 10/50600ms5728 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/0600ms1644 KiB
3Accepted1/13ms2356 KiB
4Accepted2/23ms2572 KiB
5Accepted7/73ms2628 KiB
6Time limit exceeded0/2600ms2276 KiB
7Time limit exceeded0/2575ms4368 KiB
8Time limit exceeded0/2570ms4576 KiB
9Time limit exceeded0/2546ms4568 KiB
10Time limit exceeded0/2570ms4788 KiB
11Time limit exceeded0/2564ms5016 KiB
12Time limit exceeded0/2573ms5080 KiB
13Time limit exceeded0/2555ms5096 KiB
14Time limit exceeded0/2552ms5352 KiB
15Time limit exceeded0/2560ms5624 KiB
16Time limit exceeded0/2560ms5488 KiB
17Time limit exceeded0/2552ms5512 KiB
18Time limit exceeded0/2573ms5724 KiB
19Time limit exceeded0/3564ms5584 KiB
20Time limit exceeded0/3564ms5660 KiB
21Time limit exceeded0/2564ms5596 KiB
22Time limit exceeded0/2564ms5656 KiB
23Time limit exceeded0/2568ms5728 KiB
24Time limit exceeded0/2570ms5656 KiB