library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub hidehic0/library

:warning: tests/ABC408C.py

Depends on

Code

from libs.dual_segtree import DualSegmentTree

N, M = map(int, input().split())
seg = DualSegmentTree(lambda a, b: a + b, 0, N)

for _ in [0] * M:
    l, r = map(int, input().split())
    seg.apply(l - 1, r, 1)

ans = 1000000000000000000

for i in range(N):
    ans = min(ans, seg.get(i))

print(ans)
Back to top page