250752026-02-17 19:54:28VikiVölgy (100 pont)python3Wrong answer 15/100184ms7112 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:
        if a>h:
            h = a
        aL = M[i]
        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 == 0:
    print(-1)
else:   
    print(h)


SubtaskSumTestVerdictTimeMemory
base15/100
1Wrong answer0/016ms3136 KiB
2Wrong answer0/017ms3120 KiB
3Wrong answer0/516ms3120 KiB
4Wrong answer0/514ms3124 KiB
5Wrong answer0/516ms3124 KiB
6Wrong answer0/516ms3140 KiB
7Accepted5/516ms3124 KiB
8Wrong answer0/514ms3140 KiB
9Accepted5/517ms3068 KiB
10Wrong answer0/517ms3076 KiB
11Wrong answer0/524ms3380 KiB
12Wrong answer0/532ms3124 KiB
13Wrong answer0/532ms3404 KiB
14Wrong answer0/532ms3452 KiB
15Wrong answer0/5179ms7004 KiB
16Wrong answer0/5178ms6960 KiB
17Accepted5/5175ms7112 KiB
18Wrong answer0/5184ms7092 KiB
19Wrong answer0/5178ms7080 KiB
20Wrong answer0/5179ms7076 KiB
21Wrong answer0/5174ms6948 KiB
22Wrong answer0/5180ms7076 KiB