250732026-02-17 19:53:14VikiVölgy (100 pont)python3Wrong answer 0/100186ms7188 KiB
a = 0 #aktualis hosszusag
h = 0 #leghosszabb
uL = 0 #utolso leghosszabb
Li = 0 #legmagasabb indexe
i = 0 #index
aL = 0 #aktialis legmagasabb
N = int(input())
M = []
for i in range(N):
    M.append(int(input()))

i = 0

for i in range(N): #megkeressuk a legmagasabbat, tobb eseten az utolsot
    if M[i] >= uL:
        uL = M[i]
        Li = i+1
    else:
        continue

i = 0

for i in range(Li): #elorol szamitott leghosszabb 
    if M[i] >= aL:
        aL = M[i]
        if a>h:
            h = a
            a = 0
    else:
        a += 1

i = 0
a = 0

M.reverse()

for i in range(N-Li):
    if M[i] >= aL:
        aL = M[i]
        if a>h:
            h = a
    else:
        a += 1


if h == 1:
    print(-1)
else:   
    print(h)


SubtaskSumTestVerdictTimeMemory
base0/100
1Wrong answer0/016ms3312 KiB
2Wrong answer0/017ms3312 KiB
3Wrong answer0/517ms3124 KiB
4Wrong answer0/516ms3128 KiB
5Wrong answer0/517ms3160 KiB
6Wrong answer0/516ms3104 KiB
7Wrong answer0/516ms3156 KiB
8Wrong answer0/516ms3164 KiB
9Wrong answer0/517ms2980 KiB
10Wrong answer0/517ms3124 KiB
11Wrong answer0/524ms3292 KiB
12Wrong answer0/532ms3236 KiB
13Wrong answer0/532ms3376 KiB
14Wrong answer0/532ms3380 KiB
15Wrong answer0/5172ms7168 KiB
16Wrong answer0/5172ms7188 KiB
17Wrong answer0/5174ms7080 KiB
18Wrong answer0/5186ms7076 KiB
19Wrong answer0/5174ms7080 KiB
20Wrong answer0/5178ms6948 KiB
21Wrong answer0/5178ms6948 KiB
22Wrong answer0/5175ms6948 KiB