30352023-02-08 19:06:54xxxVölgy (100 pont)cpp11Wrong answer 65/10037ms4548 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int a;
    int volgymax = 0, cnt = 0, cntmax = 0;
    for (int i =0; i < n; i++) {
        cin >> a;
        if (a >= volgymax) {
            volgymax = a;
            if (cnt > cntmax) cntmax = cnt;
            cnt = 1;
        } else {
            cnt++;
        }
    }
    if (cnt > cntmax && cnt > 2) cout << cnt - 1;
    else if (cntmax < 2) cout << -1;
    else cout << cntmax;
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base65/100
1Accepted0/03ms1748 KiB
2Wrong answer0/03ms1912 KiB
3Accepted5/53ms2272 KiB
4Accepted5/53ms2340 KiB
5Wrong answer0/53ms2588 KiB
6Wrong answer0/53ms2804 KiB
7Accepted5/53ms2940 KiB
8Accepted5/53ms3152 KiB
9Wrong answer0/53ms3364 KiB
10Wrong answer0/53ms3572 KiB
11Accepted5/54ms3788 KiB
12Accepted5/54ms3868 KiB
13Wrong answer0/54ms3868 KiB
14Wrong answer0/56ms3988 KiB
15Accepted5/530ms4192 KiB
16Accepted5/534ms4428 KiB
17Wrong answer0/534ms4364 KiB
18Accepted5/534ms4424 KiB
19Accepted5/534ms4428 KiB
20Accepted5/537ms4548 KiB
21Accepted5/537ms4304 KiB
22Accepted5/537ms4460 KiB