245382026-02-12 17:31:00VikiVölgy (100 pont)cpp17Compilation error
N = int(input()) #elemek szama
M = [] #magasagok
for i in range (N):
    M.append(int(input()))
a = 0 #aktualis hossz
h = 0 #eddigi leghosszabb
L = 0 #jelenlegi legmagasabb
i = 0
N = []

while M[i] <= M[i+1]: #felesleges elemek a lista elejetol
    M.pop(i)
M.reverse() 
while M[i] <= M[i+1]: #felesleges elemek a lista hatuljatol
    M.pop(i)
M.reverse() #eredeti sorrendre
i=0
for i in range(len(M)):
    if M[i] >= L: #ha a jelenlegi elem nagyobb az elozo legnagyobbnal
        if a>h:
            h = a
            a = 0
        L = M[i]
    else:
        a += 1
i = 0
a = 0
M.reverse()
"""if M[i] < L:
    N.append(M[0])
    while M[i] != L:
        i += 1
        N.append(M[i])
    M = N"""
i = 0
L = 0
for i in range(len(M)):
    if M[i] >= L: #ha a jelenlegi elem nagyobb az elozo legnagyobbnal
        if a>h:
            h = a
            a = 0
        L = M[i]
    else:
        a += 1

if h == 0:
    print("-1")
else:
    print(h+1)
Compilation error
open /var/local/lib/isolate/425/box/a.out: no such file or directory
main.cpp:1:18: error: stray '#' in program
    1 | N = int(input()) #elemek szama
      |                  ^
main.cpp:2:8: error: stray '#' in program
    2 | M = [] #magasagok
      |        ^
main.cpp:5:7: error: stray '#' in program
    5 | a = 0 #aktualis hossz
      |       ^
main.cpp:6:7: error: stray '#' in program
    6 | h = 0 #eddigi leghosszabb
      |       ^
main.cpp:7:7: error: stray '#' in program
    7 | L = 0 #jelenlegi legmagasabb
      |       ^
main.cpp:11:23: error: stray '#' in program
   11 | while M[i] <= M[i+1]: #felesleges elemek a lista elejetol
      |                       ^
main.cpp:14:23: error: stray '#' in program
   14 | while M[i] <= M[i+1]: #felesleges elemek a lista hatuljatol
      |                       ^
main.cpp:16:13: error: stray '#' in program
   16 | M.reverse() #eredeti sorrendre
      |             ^
main.cpp:19:19: error: stray '#' in program
   19 |     if M[i] >= L: #ha a jelenlegi elem nagyobb az elozo legnagyobbnal
      |                   ^
main.cpp:29:3: warning: missing terminating " character
   29 | """if M[i] < L:
      |   ^
main.cpp:29:3: error: missing terminating " character
   29 | """if M[i] < L:
      |   ^~~~~~~~~~~~~
main.cpp:34:12: warning: missing terminating " character
   34 |     M = N"""
      |            ^
main.cpp:34:12: error: missing terminating " character
main.cpp:38:19: error: stray '#' in program
   38 |     if M[i] >= L: #ha a jelenlegi elem nagyobb az elozo legnagyobbnal
      |                   ^
main.cpp:1:1: error: 'N' does not name a type
    1 | N = int(input()) #elemek szama
      | ^