38322023-03-03 10:51:33DalmaVölgy (100 pont)cpp17Wrong answer 0/10037ms5412 KiB
#include <iostream>

using namespace std;

int main()
{
    int hosszusag;
    cin >> hosszusag;
    int meterek[hosszusag];
    for (int i=0; i<hosszusag; i++)
    {
        cin >> meterek[i];
    }
    cout << endl;
    int volgy=0;
    int ujvolgy=0;
    int mero=0;
    volgy=0;
    for (int i=0; i<hosszusag; i++)
    {
        ujvolgy++;
        if (ujvolgy>volgy)
        {
            volgy=ujvolgy;
        }
        if (meterek[i]==mero||meterek[i]>mero)
        {
            mero=meterek[i];
            ujvolgy=1;
        }
    }
    if (volgy<=1)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << volgy << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/100
1Wrong answer0/03ms2028 KiB
2Wrong answer0/03ms2088 KiB
3Wrong answer0/53ms2300 KiB
4Wrong answer0/53ms2512 KiB
5Wrong answer0/53ms2720 KiB
6Wrong answer0/53ms2940 KiB
7Wrong answer0/53ms3148 KiB
8Wrong answer0/53ms3332 KiB
9Wrong answer0/53ms3588 KiB
10Wrong answer0/53ms3656 KiB
11Wrong answer0/54ms3928 KiB
12Wrong answer0/54ms4132 KiB
13Wrong answer0/54ms4012 KiB
14Wrong answer0/56ms4088 KiB
15Wrong answer0/532ms5036 KiB
16Wrong answer0/534ms5248 KiB
17Wrong answer0/534ms5300 KiB
18Wrong answer0/534ms5412 KiB
19Wrong answer0/534ms5384 KiB
20Wrong answer0/537ms5388 KiB
21Wrong answer0/537ms5384 KiB
22Wrong answer0/537ms5384 KiB