48532023-04-02 19:16:30Laci3000Völgy (100 pont)cpp11Wrong answer 30/100272ms5060 KiB
#include <iostream>
#include <vector>


using namespace std;

vector<int> beolvasas() {
    int sorok_szama;
    cin >> sorok_szama;

    vector<int> beolvasottak(sorok_szama);

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


    return beolvasottak;
}

int feldolgozas(vector<int> t, int hely) {
    int a = 1;
    int ertek = t[hely];
    for (int i = hely; i < t.size() - 1; i++)
    {
        if (ertek > t[i + 1]) {
            a++;
        }
        else {
            a++;
            break;
        }
    }
    return a;
}

int befejezes(vector<int> lista) {
    vector<int> maximumkereso(lista.size() - 1);
    for (int i = 0; i < lista.size() - 1; i++)
    {
        maximumkereso[i] = feldolgozas(lista, i);

    }int a = maximumkereso[0];
    for (int i = 1; i < maximumkereso.size(); i++)
    {
        if (a < maximumkereso[i]) {
            a = maximumkereso[i];
        }
    }
    if (a < 3) {
        a = -1;
    }
    else {
        
        a = a - 1;
    }
    return a;
}

int main()
{
    vector<int> adatok = beolvasas();
    cout << befejezes(adatok);
}
SubtaskSumTestVerdictTimeMemory
base30/100
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2016 KiB
3Accepted5/53ms2216 KiB
4Accepted5/53ms2428 KiB
5Wrong answer0/52ms2512 KiB
6Wrong answer0/53ms2512 KiB
7Accepted5/52ms2508 KiB
8Accepted5/53ms2756 KiB
9Wrong answer0/53ms2860 KiB
10Wrong answer0/53ms3080 KiB
11Accepted5/59ms3496 KiB
12Accepted5/525ms3888 KiB
13Wrong answer0/527ms3988 KiB
14Wrong answer0/524ms4352 KiB
15Time limit exceeded0/5256ms4756 KiB
16Time limit exceeded0/5268ms4672 KiB
17Time limit exceeded0/5252ms4996 KiB
18Time limit exceeded0/5270ms4928 KiB
19Time limit exceeded0/5268ms4988 KiB
20Time limit exceeded0/5256ms5000 KiB
21Time limit exceeded0/5252ms5060 KiB
22Time limit exceeded0/5272ms5056 KiB