7242021-12-21 13:12:28kismartongInverziócpp11Wrong answer 6/50569ms62980 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;
    bool megvan = false;
    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;
                megvan = true;
                break;
            }
        }
        if (megvan == true)
            break;
    }
    printf("%d %d", kezd, veg);
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/03ms1884 KiB
2Wrong answer0/016ms2844 KiB
3Wrong answer0/11ms2284 KiB
4Accepted2/21ms2296 KiB
5Wrong answer0/71ms2304 KiB
6Wrong answer0/217ms3180 KiB
7Wrong answer0/2158ms9920 KiB
8Wrong answer0/2167ms13208 KiB
9Wrong answer0/2160ms16516 KiB
10Accepted2/2165ms19872 KiB
11Wrong answer0/2181ms23208 KiB
12Wrong answer0/2165ms26392 KiB
13Wrong answer0/2158ms29752 KiB
14Wrong answer0/2157ms33068 KiB
15Wrong answer0/2159ms36400 KiB
16Wrong answer0/2158ms39708 KiB
17Wrong answer0/2164ms43060 KiB
18Wrong answer0/2156ms46368 KiB
19Wrong answer0/3173ms49676 KiB
20Wrong answer0/3165ms53008 KiB
21Wrong answer0/2167ms56352 KiB
22Wrong answer0/2163ms59640 KiB
23Accepted2/2172ms62980 KiB
24Time limit exceeded0/2569ms62076 KiB