- 校门外的树
** If you want to AC ,Looking there! **
- 2025-7-8 17:26:38 @
来!随便看,随便抄!
fenghaochen
#include<bits/stdc++.h>
using namespace std;
int main(){
int a[10000];
int l,m,Start,End,sum=0;
cin>>l>>m;
for(int i=0;i<=l;i++){
a[i]=1;
}
for(int i=1;i<=m;i++){
cin>>Start>>End;
for(int j=Start;j<=End;j++){
a[j]=0;
}
}
for(int i=0;i<=l;i++){
if(a[i]){
sum++;
}
}cout<<sum;
return 0;
}
最后,请大家 点个赞 吧~
支持一下这位学c++的小孩呀~~
信息
- ID
- 109
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 5
- 标签
- (无)
- 递交数
- 296
- 已通过
- 114
- 上传者