社区讨论
NOI openjudge迷惑行为
P1047[NOIP 2005 普及组] 校门外的树参与者 6已保存回复 10
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 10 条
- 当前快照
- 1 份
- 快照标识符
- @locu48j7
- 此快照首次捕获于
- 2023/10/30 19:46 2 年前
- 此快照最后确认于
- 2023/11/05 06:23 2 年前
蒟蒻的代码:
CPP#include<bits/stdc++.h>
using namespace std;
int main(){
bool tree[10001]={0};
int tr[10001],n,a,b,m,count;
scanf("%d",&n);
for(int i=0;i<=n;i++){
tr[i]=i;
}
scanf("%d",&m);
for(int i=1;i<=m;i++){
cin>>a>>b;
for(int j=a;j<=b;j++){
if(tree[j]==false) tree[j]=true;
}
}
for(int i=0;i<=n;i++){
if(tree[i]==false) count++;
}
printf("%d",count);
return 0;
}
各位大神高抬贵手帮帮忙
回复
共 10 条回复,欢迎继续交流。
正在加载回复...