250772026-02-17 19:58:11VikiVölgy (100 pont)python3Wrong answer 15/100181ms7212 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
if N > 2:
    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
            a = 0
            aL = M[i]
        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/016ms3312 KiB
2Wrong answer0/017ms3192 KiB
3Wrong answer0/516ms3124 KiB
4Wrong answer0/516ms3124 KiB
5Wrong answer0/517ms3116 KiB
6Wrong answer0/516ms2940 KiB
7Accepted5/516ms3308 KiB
8Wrong answer0/514ms3100 KiB
9Accepted5/517ms3312 KiB
10Wrong answer0/517ms3116 KiB
11Wrong answer0/524ms3380 KiB
12Wrong answer0/532ms3124 KiB
13Wrong answer0/532ms3520 KiB
14Wrong answer0/532ms3536 KiB
15Wrong answer0/5177ms7168 KiB
16Wrong answer0/5179ms7204 KiB
17Accepted5/5180ms6948 KiB
18Wrong answer0/5179ms7072 KiB
19Wrong answer0/5172ms6948 KiB
20Wrong answer0/5180ms7200 KiB
21Wrong answer0/5179ms6952 KiB
22Wrong answer0/5181ms7212 KiB