7232021-12-21 13:02:59kismartongInverziócpp14Time limit exceeded 9/50598ms54856 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, c;
    cin >> n;
    vector<int> szamok;
    for (int i = 0; i < n; i++) {
        cin >> c;
        szamok.push_back(c);
    }
    int maxi = 0;
    int kezd = 0;
    int veg = 0;
    for (int i = 0; i < n; i++) {
        for (int j = n-1; j > i; j--) {
            if (szamok[i] > szamok[j] && j-i > maxi) {
                maxi = j-i;
                kezd = i + 1;
                veg = j + 1;
                break;
            }
        }
    }
    printf("%d %d", kezd, veg);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/02ms1740 KiB
2Time limit exceeded0/0593ms1528 KiB
3Wrong answer0/11ms2104 KiB
4Accepted2/23ms2124 KiB
5Accepted7/72ms2124 KiB
6Time limit exceeded0/2596ms1844 KiB
7Time limit exceeded0/2510ms6856 KiB
8Time limit exceeded0/2540ms10164 KiB
9Time limit exceeded0/2512ms13548 KiB
10Time limit exceeded0/2514ms16820 KiB
11Time limit exceeded0/2529ms20204 KiB
12Time limit exceeded0/2518ms23292 KiB
13Time limit exceeded0/2555ms26700 KiB
14Time limit exceeded0/2504ms30128 KiB
15Time limit exceeded0/2598ms33284 KiB
16Time limit exceeded0/2589ms36504 KiB
17Time limit exceeded0/2592ms39848 KiB
18Time limit exceeded0/2596ms43240 KiB
19Time limit exceeded0/3566ms46612 KiB
20Time limit exceeded0/3597ms49772 KiB
21Time limit exceeded0/2596ms53168 KiB
22Time limit exceeded0/2596ms54856 KiB
23Time limit exceeded0/2597ms54716 KiB
24Time limit exceeded0/2583ms54716 KiB