#include<bits/stdc++.h>
using namespace std;
bool tree[10001];
int main()
{
memset(tree,1,sizeof(tree));
long long l,n,u[101],v[101];
cin>>l>>n;
for(int i=1;i<=n;i++)
cin>>u[i]>>v[i];
for(int i=1;i<=n;i++)
for(int j=u[i];j<=v[i];j++)
tree[j]=0;
int ans=0;
for(int i=1;i<=l;i++)
if(tree[i]==1)
ans++;
cout<<ans+1<<endl;
return 0;
}
为什么90?
大佬求调