250802026-02-17 20:18:32VikiVölgy (100 pont)python3Wrong answer 60/100185ms7104 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 == 0: 
    print("-1")
else:
    print(h+1)
SubtaskSumTestVerdictTimeMemory
base60/100
1Accepted0/014ms3312 KiB
2Wrong answer0/017ms3144 KiB
3Accepted5/516ms3124 KiB
4Accepted5/516ms3120 KiB
5Wrong answer0/517ms3124 KiB
6Accepted5/517ms3112 KiB
7Accepted5/517ms3128 KiB
8Accepted5/517ms3120 KiB
9Accepted5/517ms3324 KiB
10Wrong answer0/517ms3116 KiB
11Accepted5/525ms3376 KiB
12Wrong answer0/532ms3396 KiB
13Wrong answer0/534ms3484 KiB
14Wrong answer0/532ms3516 KiB
15Wrong answer0/5180ms7104 KiB
16Wrong answer0/5180ms7060 KiB
17Accepted5/5182ms6944 KiB
18Accepted5/5164ms6944 KiB
19Wrong answer0/5182ms6944 KiB
20Accepted5/5168ms6948 KiB
21Accepted5/5185ms6964 KiB
22Accepted5/5166ms6948 KiB