185132025-10-25 14:17:35Firesloth28Legmesszebbi rossz sorrendű (35 pont)cpp17Time limit exceeded 9/35300ms748 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

	int n;
    int a[100001];

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    int maxDiff = 0;
    int x, y;

    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (a[i] > a[j]) {
                if (j - i > maxDiff) {
                    maxDiff = j - i;
                    x = i + 1;
                    y = j + 1;
                }
            }
        }
    }

    if (maxDiff) {
        cout << x << " " << y;
    }
    else {
        cout << "-1";
    }
}
SubtaskSumTestVerdictTimeMemory
base9/35
1Accepted0/01ms316 KiB
2Time limit exceeded0/0282ms580 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Accepted1/11ms316 KiB
6Accepted1/11ms316 KiB
7Accepted1/11ms316 KiB
8Accepted1/12ms316 KiB
9Accepted1/14ms440 KiB
10Accepted1/18ms508 KiB
11Accepted1/114ms500 KiB
12Time limit exceeded0/2298ms564 KiB
13Time limit exceeded0/2300ms564 KiB
14Time limit exceeded0/2300ms564 KiB
15Time limit exceeded0/2289ms316 KiB
16Time limit exceeded0/2291ms564 KiB
17Time limit exceeded0/2293ms564 KiB
18Time limit exceeded0/2300ms704 KiB
19Time limit exceeded0/2284ms564 KiB
20Time limit exceeded0/2284ms564 KiB
21Time limit exceeded0/2286ms564 KiB
22Time limit exceeded0/2300ms564 KiB
23Time limit exceeded0/2284ms568 KiB
24Time limit exceeded0/2275ms748 KiB