50452023-04-11 13:18:45Laci3000Völgy (100 pont)cpp17Wrong answer 45/100268ms13964 KiB
#include <iostream>
#include <vector>


using namespace std;



int elozoertek = 0;

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];
    elozoertek = ertek;
    

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

int befejezes(vector<int> lista) {
    vector<int> maximumkereso(lista.size() - 1);
    for (int i = 0; i < lista.size() - 1; i++)
    {
        if (elozoertek < lista[i]) {
            maximumkereso.push_back(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;
    }
    
    return a;
}

int main()
{
    vector<int> adatok = beolvasas();
    cout << befejezes(adatok);
}

SubtaskSumTestVerdictTimeMemory
base45/100
1Accepted0/03ms2072 KiB
2Wrong answer0/03ms2324 KiB
3Wrong answer0/53ms2524 KiB
4Accepted5/53ms2900 KiB
5Wrong answer0/53ms2820 KiB
6Wrong answer0/53ms2980 KiB
7Accepted5/53ms3108 KiB
8Accepted5/53ms3352 KiB
9Wrong answer0/53ms3440 KiB
10Wrong answer0/53ms3544 KiB
11Accepted5/54ms3940 KiB
12Wrong answer0/54ms4068 KiB
13Accepted5/56ms4292 KiB
14Wrong answer0/56ms4600 KiB
15Wrong answer0/532ms8656 KiB
16Accepted5/535ms9424 KiB
17Wrong answer0/535ms10228 KiB
18Time limit exceeded0/5268ms8468 KiB
19Accepted5/535ms11832 KiB
20Time limit exceeded0/5261ms10128 KiB
21Accepted5/541ms13280 KiB
22Accepted5/5186ms13964 KiB