# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1239417 | woe | Infinite Race (EGOI24_infiniterace2) | Pypy 3 | 0 ms | 0 KiB |
7n = int(input())
e = int(input())
lap = 0
ahead = set()
for _ in range(e):
x = int(input())
if x > 0:
if x in ahead:
lap += 1
ahead.clear()
ahead.add(x)
else:
ahead.discard(-x)
print(lap)