Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
108895 展博 校门外的树 Python3 Accepted 53 MS 4740 KB 227 2025-01-23 10:55:06

Tests(10/10):


Code:

def f(L, M, r): s = set() for a, b in r: s.update(range(a, b + 1)) return L + 1 - len(s) L, M = map(int, input().split()) r = [tuple(map(int, input().split())) for _ in range(M)] print(f(L, M, r))