77122024-01-10 14:39:42PeterInverziócpp17Time limit exceeded 10/50600ms5752 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    int N;
    vector<int> sorozat;
    cin >> N;
    sorozat.resize(N);
    for (int i = 0, t; i < N; i++) {
        cin >> sorozat[i];
    }

    int maxinverzio = 0;
    int maxhelykezd = -1;
    int maxhelyveg = -1;
    for (int i = 0; i < N; i++) {
        for (int j = i; j < N; j++) {
            if (sorozat[i] > sorozat[j] && j - i > maxinverzio) {
                maxinverzio = j - i;
                maxhelykezd = i;
                maxhelyveg = j;

                //cout << maxinverzio << " " << maxhelykezd << " " << maxhelyveg << "\n";



            }
        }
    }

    if (maxhelykezd==-1) {
        cout << -1;
    }
    else {
        cout << maxhelykezd+1 << " " << maxhelyveg+1;
    }

    return 0;

}
SubtaskSumTestVerdictTimeMemory
base10/50
1Accepted0/03ms1828 KiB
2Time limit exceeded0/0600ms1520 KiB
3Accepted1/13ms2244 KiB
4Accepted2/24ms2468 KiB
5Accepted7/74ms2504 KiB
6Time limit exceeded0/2547ms2168 KiB
7Time limit exceeded0/2566ms4032 KiB
8Time limit exceeded0/2574ms3920 KiB
9Time limit exceeded0/2583ms3880 KiB
10Time limit exceeded0/2555ms3956 KiB
11Time limit exceeded0/2535ms4268 KiB
12Time limit exceeded0/2550ms4280 KiB
13Time limit exceeded0/2555ms4264 KiB
14Time limit exceeded0/2563ms4624 KiB
15Time limit exceeded0/2566ms4532 KiB
16Time limit exceeded0/2550ms4724 KiB
17Time limit exceeded0/2533ms4672 KiB
18Time limit exceeded0/2552ms4988 KiB
19Time limit exceeded0/3578ms5052 KiB
20Time limit exceeded0/3565ms5196 KiB
21Time limit exceeded0/2566ms5300 KiB
22Time limit exceeded0/2561ms5596 KiB
23Time limit exceeded0/2574ms5468 KiB
24Time limit exceeded0/2565ms5752 KiB