Submission #1187918

#TimeUsernameProblemLanguageResultExecution timeMemory
1187918ofozInfinite Race (EGOI24_infiniterace2)C++20
Compilation error
0 ms0 KiB
from sys import setrecursionlimit, stdout from math import ceil, floor def solve(): n = int(input()) q = int(input()) lapped = dict() for i in range(n): lapped[i] = 0 currentAhead = set() res = 0 for _ in range(q): x = int(input()) i = abs(x) if x < 0: if i in currentAhead: currentAhead.remove(i) elif i in currentAhead: res += 1 currentAhead.clear() currentAhead.add(i) else: currentAhead.add(i) # print(lapped) print(res) return # for us to be sure that she must have crossed the finish line, # she must overtake someone that she just overtook. and since, its the minimal case, the answer will be the maximum of all the times she overtook someone she just overtook # let a[i] be 0 if theyre ahead of her and 1 if behind her. # solve()

Compilation message (stderr)

Main.cpp:26:7: error: invalid preprocessing directive #print
   26 |     # print(lapped)
      |       ^~~~~
Main.cpp:31:3: error: invalid preprocessing directive #for
   31 | # for us to be sure that she must have crossed the finish line,
      |   ^~~
Main.cpp:32:3: error: invalid preprocessing directive #she
   32 | # she must overtake someone that she just overtook. and since, its the minimal case, the answer will be the maximum of all the times she overtook someone she just overtook
      |   ^~~
Main.cpp:33:3: error: invalid preprocessing directive #let
   33 | # let a[i] be 0 if theyre ahead of her and 1 if behind her.
      |   ^~~
Main.cpp:1:1: error: 'from' does not name a type
    1 | from sys import setrecursionlimit, stdout
      | ^~~~