文章
35
粉丝
0
获赞
144
访问
7.3k
#include <bits/stdc++.h>
using namespace std;
int main() {
int L,M;
while(cin>>L>>M){
vector<int> t(L+1,1);
int start,end;
for(int i=0;i<M;i++){
cin>>start>>end;
for(int j=start;j<=end;j++){
t[j]=0;
}
}
int s=0;
for(int i=0;i<t.size();i++){
if(t[i]==1) s++;
}
cout<<s<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发