38342023-03-03 10:53:56DalmaVölgy (100 pont)cpp17Wrong answer 65/10039ms4892 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];
    }
    int volgy=0;
    int ujvolgy=0;
    int mero=0;
    volgy=0;
    for (int i=0; i<hosszusag; i++)
    {
        if (meterek[i]==mero||meterek[i]>mero)
        {
            mero=meterek[i];
            ujvolgy=0;
        }
        ujvolgy++;
        if (ujvolgy>volgy)
        {
            volgy=ujvolgy;
        }
    }
    if (volgy<=1)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << volgy << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base65/100
1Accepted0/03ms1872 KiB
2Wrong answer0/03ms2080 KiB
3Accepted5/53ms2296 KiB
4Accepted5/53ms2504 KiB
5Wrong answer0/52ms2592 KiB
6Wrong answer0/53ms2840 KiB
7Accepted5/53ms2956 KiB
8Accepted5/52ms3040 KiB
9Wrong answer0/53ms3172 KiB
10Wrong answer0/53ms3292 KiB
11Accepted5/54ms3276 KiB
12Accepted5/54ms3636 KiB
13Wrong answer0/54ms3712 KiB
14Wrong answer0/56ms3600 KiB
15Accepted5/530ms4336 KiB
16Accepted5/535ms4468 KiB
17Wrong answer0/534ms4552 KiB
18Accepted5/534ms4552 KiB
19Accepted5/534ms4664 KiB
20Accepted5/537ms4788 KiB
21Accepted5/539ms4892 KiB
22Accepted5/537ms4880 KiB