250602026-02-17 16:49:30VikiVölgy (100 pont)python3Wrong answer 20/100180ms7132 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
    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
base20/100
1Accepted0/016ms3120 KiB
2Wrong answer0/017ms3316 KiB
3Accepted5/516ms3080 KiB
4Wrong answer0/516ms3040 KiB
5Wrong answer0/516ms3140 KiB
6Wrong answer0/517ms3124 KiB
7Accepted5/517ms2996 KiB
8Wrong answer0/516ms3320 KiB
9Accepted5/517ms3064 KiB
10Wrong answer0/517ms3068 KiB
11Wrong answer0/524ms3160 KiB
12Wrong answer0/530ms3144 KiB
13Wrong answer0/532ms3516 KiB
14Wrong answer0/530ms3396 KiB
15Wrong answer0/5179ms7132 KiB
16Wrong answer0/5173ms7116 KiB
17Accepted5/5178ms7008 KiB
18Wrong answer0/5178ms6940 KiB
19Wrong answer0/5180ms6944 KiB
20Wrong answer0/5177ms6948 KiB
21Wrong answer0/5173ms6948 KiB
22Wrong answer0/5180ms6948 KiB