250722026-02-17 19:52:48VikiVölgy (100 pont)python3Wrong answer 15/100190ms7152 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
base15/100
1Wrong answer0/016ms3060 KiB
2Wrong answer0/017ms3124 KiB
3Wrong answer0/516ms3124 KiB
4Wrong answer0/516ms3124 KiB
5Wrong answer0/517ms3124 KiB
6Wrong answer0/517ms3320 KiB
7Accepted5/517ms3120 KiB
8Wrong answer0/517ms3116 KiB
9Accepted5/518ms3124 KiB
10Wrong answer0/518ms3120 KiB
11Wrong answer0/525ms3380 KiB
12Wrong answer0/532ms3124 KiB
13Wrong answer0/532ms3372 KiB
14Wrong answer0/532ms3368 KiB
15Wrong answer0/5174ms7152 KiB
16Wrong answer0/5174ms7040 KiB
17Accepted5/5174ms7080 KiB
18Wrong answer0/5190ms7076 KiB
19Wrong answer0/5172ms6952 KiB
20Wrong answer0/5178ms6948 KiB
21Wrong answer0/5180ms6948 KiB
22Wrong answer0/5175ms6948 KiB