HuTaoJiaZiBuJia @ 2024-09-06 18:53:24
#include<bits/stdc++.h>
using namespace std;
int l,m,a[10005];
int main(){
cin>>l>>m;
for(int i=1;i<=m;i++){
int t1,t2;
cin>>t1,t2;
a[t1]++;
a[t2+1]--;
}
for(int i=1;i<=l;i++){
a[i]+=a[i-1];
}
int cnt;
for(int i=0;i<=l;i++){
if(!a[i]) cnt++;
}
cout<<cnt;
}
全WA了,插粪做的,沃步里姐
by HuTaoJiaZiBuJia @ 2024-09-08 16:34:47
@wangxiaoyi1118 60