131182025-01-06 16:58:46MagyarKendeSZLGInverziócpp17Wrong answer 3/50245ms4408 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<array<int, 2>> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i][0];
        a[i][1] = i;
    }
    sort(a.rbegin(), a.rend());
    int mx_j = -1, mn_i = 1e9;
    for (auto [x, i] : a) {
        if (mn_i > i) mn_i = i;
        mx_j = max(mx_j, i);
    }
    if (mx_j - mn_i > 0) {
        cout << mn_i + 1 << " " << mx_j + 1 << "\n";
    } else {
        cout << "-1\n";
    }
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/01ms500 KiB
2Wrong answer0/018ms756 KiB
3Accepted1/11ms316 KiB
4Accepted2/21ms316 KiB
5Wrong answer0/71ms316 KiB
6Wrong answer0/221ms564 KiB
7Wrong answer0/2208ms4320 KiB
8Wrong answer0/2244ms4320 KiB
9Wrong answer0/2245ms4148 KiB
10Wrong answer0/2239ms4148 KiB
11Wrong answer0/2239ms4148 KiB
12Wrong answer0/2236ms4148 KiB
13Wrong answer0/2238ms4096 KiB
14Wrong answer0/2238ms4340 KiB
15Wrong answer0/2197ms4148 KiB
16Wrong answer0/2241ms4148 KiB
17Wrong answer0/2239ms4316 KiB
18Wrong answer0/2238ms4148 KiB
19Wrong answer0/3200ms4148 KiB
20Wrong answer0/3200ms4408 KiB
21Wrong answer0/2203ms4148 KiB
22Wrong answer0/2240ms4148 KiB
23Wrong answer0/2241ms4344 KiB
24Wrong answer0/2188ms4148 KiB