Submission #1160684

#TimeUsernameProblemLanguageResultExecution timeMemory
1160684gabriela-l_h123$Infinite Race (EGOI24_infiniterace2)C++20
Compilation error
0 ms0 KiB
def carrera_infinita(N, eventos):
    vueltas = 0
    adelantamientos = 0
    
    for x in eventos:
        if x > 0:
            adelantamientos += 1
        else:
            adelantamientos -= 1
        
        if adelantamientos < 0:
            vueltas += 1
            adelantamientos = 0
    
    return vueltas


N, Q = map(int, input().split())
eventos = [int(input()) for _ in range(Q)]


print(carrera_infinita(N, eventos))

Compilation message (stderr)

Main.cpp:1:1: error: 'def' does not name a type
    1 | def carrera_infinita(N, eventos):
      | ^~~