7362022-01-01 12:51:50Molnár AttilaInverziócpp11Wrong answer 6/50231ms123628 KiB
// Nemes2021Inverzio.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
using namespace std;

/// Ez a redundas rekurzio miatt idotullepessel vagy stackoverflowval biztos porul jar, de kivancsi vagyok, hany pontot szerez
vector<int> mo(vector<int> &t, int e, int v)
{
    if (t[e] > t[v])
        return vector<int>{e, v};
    vector<int> mov = mo(t, e, v - 1);
    if (mov[0]!=-1)
        return mov;
    mov = mo(t, e + 1, v);
    if (mov[0] != -1)
        return mov;
    return vector<int>{ -1, -1 };
}

int main()
{
    int N;
    cin >> N;
    vector<int> v (N);

    for (int i = 0; i < N; i++)
        cin >> v[i];

    vector<int> mov = mo(v, 0, N - 1);

    cout << mov[0] + 1 << " " << mov[1] + 1; 
}


/*

*/
SubtaskSumTestVerdictTimeMemory
base6/50
1Accepted0/02ms1996 KiB
2Wrong answer0/030ms13608 KiB
3Wrong answer0/11ms2320 KiB
4Accepted2/21ms2332 KiB
5Wrong answer0/71ms2440 KiB
6Wrong answer0/221ms13564 KiB
7Wrong answer0/2226ms118528 KiB
8Wrong answer0/2215ms114488 KiB
9Wrong answer0/2216ms123364 KiB
10Accepted2/2193ms82788 KiB
11Wrong answer0/2194ms86744 KiB
12Wrong answer0/2197ms103072 KiB
13Wrong answer0/2203ms110428 KiB
14Wrong answer0/2206ms110428 KiB
15Wrong answer0/2231ms123628 KiB
16Wrong answer0/2199ms83076 KiB
17Wrong answer0/2177ms53304 KiB
18Wrong answer0/2200ms107236 KiB
19Wrong answer0/3214ms123628 KiB
20Wrong answer0/3212ms123624 KiB
21Wrong answer0/2216ms123628 KiB
22Wrong answer0/2218ms98436 KiB
23Accepted2/2181ms79660 KiB
24Wrong answer0/2210ms123624 KiB