You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mycode/ACM/校门外的树.py

7 lines
162 B

5 months ago
a,b =map(int, input().split(' '))
nums=[]
for i in range(b):
m,n=map(int,input().split(' '))
nums.extend(range(m,n+1))
nums=set(nums)
print(a+1-len(nums))