69932023-12-24 15:06:43MagyarKendeSZLGInverziócpp17Time limit exceeded 14/50586ms7096 KiB
#include <iostream>
#include <vector>
#include <array>
using namespace std;
#define speed cin.tie(0); ios::sync_with_stdio(0)

using point = array<int, 2>;

int main() {
    speed;

    int N;
    cin >> N;
    vector<int> v(N);
    for (int i = 0; i < N; i++) {
        cin >> v[i];
    }

    point p {0, 0};
    for (int l = N; l > 0; l--) {
        for (int i = 0, j = l - 1; j < N; i++, j++) {
            if (v[i] > v[j]) {
                cout << i + 1 << ' ' << j + 1;
                exit(0);
            }
        }
    }
    cout << -1;
}
SubtaskSumTestVerdictTimeMemory
base14/50
1Accepted0/03ms1976 KiB
2Time limit exceeded0/0535ms2576 KiB
3Accepted1/13ms2240 KiB
4Accepted2/23ms2460 KiB
5Accepted7/73ms2528 KiB
6Accepted2/2201ms2924 KiB
7Time limit exceeded0/2566ms3916 KiB
8Time limit exceeded0/2565ms4224 KiB
9Accepted2/264ms7096 KiB
10Time limit exceeded0/2554ms4220 KiB
11Time limit exceeded0/2554ms4352 KiB
12Time limit exceeded0/2554ms4372 KiB
13Time limit exceeded0/2561ms4392 KiB
14Time limit exceeded0/2586ms4408 KiB
15Time limit exceeded0/2542ms4464 KiB
16Time limit exceeded0/2569ms4464 KiB
17Time limit exceeded0/2574ms4664 KiB
18Time limit exceeded0/2552ms4720 KiB
19Time limit exceeded0/3550ms4664 KiB
20Time limit exceeded0/3541ms4664 KiB
21Time limit exceeded0/2561ms4844 KiB
22Time limit exceeded0/2574ms4648 KiB
23Time limit exceeded0/2554ms4632 KiB
24Time limit exceeded0/2558ms4716 KiB