7222021-12-21 12:55:12kismartongInverziócpp14Time limit exceeded 9/50597ms63468 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;
            }
        }
    }
    printf("%d %d", kezd, veg);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/02ms1884 KiB
2Time limit exceeded0/0537ms1864 KiB
3Wrong answer0/11ms2324 KiB
4Accepted2/23ms2328 KiB
5Accepted7/73ms2344 KiB
6Time limit exceeded0/2501ms2156 KiB
7Time limit exceeded0/2578ms7160 KiB
8Time limit exceeded0/2536ms10536 KiB
9Time limit exceeded0/2595ms13700 KiB
10Time limit exceeded0/2597ms17028 KiB
11Time limit exceeded0/2593ms20456 KiB
12Time limit exceeded0/2570ms23568 KiB
13Time limit exceeded0/2596ms26960 KiB
14Time limit exceeded0/2596ms30360 KiB
15Time limit exceeded0/2582ms33492 KiB
16Time limit exceeded0/2593ms37108 KiB
17Time limit exceeded0/2589ms40304 KiB
18Time limit exceeded0/2592ms43640 KiB
19Time limit exceeded0/3578ms46864 KiB
20Time limit exceeded0/3597ms50164 KiB
21Time limit exceeded0/2595ms53564 KiB
22Time limit exceeded0/2596ms56800 KiB
23Time limit exceeded0/2597ms60108 KiB
24Time limit exceeded0/2595ms63468 KiB