69922023-12-24 14:54:07MagyarKendeSZLGInverziócpp17Time limit exceeded 12/50600ms4932 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 i = 0; i < N; i++) {
        for (int j = i + 1 + (p[1] - p[0]); j < N; j++) {
            if (v[i] > v[j] && j - i > p[1] - p[0]) {
                p = {i, j};
            }
        }
    }

    if (p[0] || p[1]) {
        cout << p[0] + 1 << ' ' << p[1] + 1;
    } else {
        cout << -1;
    }
}
SubtaskSumTestVerdictTimeMemory
base12/50
1Accepted0/03ms1824 KiB
2Time limit exceeded0/0600ms1544 KiB
3Accepted1/13ms2432 KiB
4Accepted2/23ms2472 KiB
5Accepted7/73ms2476 KiB
6Accepted2/2407ms2892 KiB
7Time limit exceeded0/2574ms4104 KiB
8Time limit exceeded0/2537ms4076 KiB
9Time limit exceeded0/2558ms4272 KiB
10Time limit exceeded0/2558ms4268 KiB
11Time limit exceeded0/2569ms4396 KiB
12Time limit exceeded0/2558ms4356 KiB
13Time limit exceeded0/2558ms4352 KiB
14Time limit exceeded0/2555ms4596 KiB
15Time limit exceeded0/2554ms4656 KiB
16Time limit exceeded0/2574ms4504 KiB
17Time limit exceeded0/2564ms4568 KiB
18Time limit exceeded0/2541ms4712 KiB
19Time limit exceeded0/3561ms4824 KiB
20Time limit exceeded0/3573ms4828 KiB
21Time limit exceeded0/2582ms4716 KiB
22Time limit exceeded0/2554ms4932 KiB
23Time limit exceeded0/2560ms4912 KiB
24Time limit exceeded0/2554ms4844 KiB