38302023-03-03 10:47:41DalmaVölgy (100 pont)cpp17Wrong answer 0/10037ms5356 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=1;
    int ujvolgy=0;
    int mero=0;
    for (int i=0; i<hosszusag; i++)
    {
        ujvolgy++;
        if (meterek[i]==mero||meterek[i]>mero)
        {
            mero=meterek[i];
            ujvolgy=1;
        }
        if (ujvolgy>volgy)
        {
            volgy=ujvolgy;
        }
    }
    if (volgy==1)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << volgy << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/100
1Wrong answer0/03ms1872 KiB
2Wrong answer0/03ms2128 KiB
3Wrong answer0/53ms2340 KiB
4Wrong answer0/52ms2416 KiB
5Wrong answer0/52ms2576 KiB
6Wrong answer0/53ms2544 KiB
7Wrong answer0/53ms2852 KiB
8Wrong answer0/53ms2924 KiB
9Wrong answer0/53ms3048 KiB
10Wrong answer0/53ms3140 KiB
11Wrong answer0/54ms3344 KiB
12Wrong answer0/54ms3720 KiB
13Wrong answer0/54ms3572 KiB
14Wrong answer0/56ms3700 KiB
15Wrong answer0/530ms4796 KiB
16Wrong answer0/534ms4740 KiB
17Wrong answer0/534ms4744 KiB
18Wrong answer0/534ms4852 KiB
19Wrong answer0/534ms4916 KiB
20Wrong answer0/537ms4932 KiB
21Wrong answer0/537ms5148 KiB
22Wrong answer0/537ms5356 KiB