250792026-02-17 20:15:38VikiVölgy (100 pont)python3Wrong answer 55/100196ms7176 KiB
N = int(input()) #elemek szama
M = [] #magasagok
for i in range (N):
    M.append(int(input()))
a = 0 #aktualis hossz
h = 0 #eddigi leghosszabb
L = 0 #jelenlegi legmagasabb
i = 0


if N > 2:
    for i in range(N):
        if M[i] >= L:
            if a>h:
                h = a 
            a = 0
            L = M[i] 
        else: 
            a += 1 
    i = 0 
    
    M.reverse() 
    if M[i] != L: 
        L = 0 
        a = 0
        for i in range(N):
            if M[i] >= L: 
                if a>h:
                    h = a
                    a = 0
                L = M[i]
            else:
                a += 1

if h <= 1: 
    print("-1")
else:
    print(h+1)
SubtaskSumTestVerdictTimeMemory
base55/100
1Accepted0/016ms3116 KiB
2Wrong answer0/017ms2992 KiB
3Wrong answer0/516ms3104 KiB
4Accepted5/516ms2952 KiB
5Wrong answer0/517ms2964 KiB
6Accepted5/516ms3052 KiB
7Accepted5/516ms3128 KiB
8Accepted5/514ms3140 KiB
9Accepted5/517ms3132 KiB
10Wrong answer0/517ms3124 KiB
11Accepted5/524ms3364 KiB
12Wrong answer0/532ms3244 KiB
13Wrong answer0/532ms3492 KiB
14Wrong answer0/532ms3508 KiB
15Wrong answer0/5181ms7092 KiB
16Wrong answer0/5181ms7020 KiB
17Accepted5/5196ms6944 KiB
18Accepted5/5163ms6944 KiB
19Wrong answer0/5185ms7148 KiB
20Accepted5/5162ms7176 KiB
21Accepted5/5180ms6956 KiB
22Accepted5/5164ms6948 KiB