20092022-12-13 22:03:42neszbalÁruszállítás üres szakaszaipython3Runtime error 0/50131ms29108 KiB
import sys

n, m = map(int, sys.stdin.readline().split())
c = [0] * n
for i in range(m):
    a, b = map(int, sys.stdin.readline().split())
    c[a - 1] += 1
    c[b] -= 1
d = 0
res = 0
for i in range(n):
    d += c[i]
    if d == 0:
        res += 1
print(res)
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/017ms11016 KiB
2Runtime error0/056ms27024 KiB
3Wrong answer0/217ms11644 KiB
4Runtime error0/217ms11696 KiB
5Wrong answer0/217ms11956 KiB
6Wrong answer0/217ms12340 KiB
7Wrong answer0/216ms11944 KiB
8Wrong answer0/217ms12480 KiB
9Runtime error0/217ms12740 KiB
10Runtime error0/217ms12856 KiB
11Wrong answer0/234ms13736 KiB
12Wrong answer0/241ms14332 KiB
13Runtime error0/317ms14140 KiB
14Runtime error0/320ms16228 KiB
15Runtime error0/320ms16256 KiB
16Runtime error0/3119ms28880 KiB
17Runtime error0/3129ms28932 KiB
18Runtime error0/3131ms28964 KiB
19Runtime error0/324ms19800 KiB
20Runtime error0/325ms21020 KiB
21Runtime error0/346ms28944 KiB
22Runtime error0/334ms29108 KiB