| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 154764 | 余建成 | 校门外的树 | C++ | Accepted | 2 MS | 276 KB | 445 | 2026-05-30 20:20:35 |
#include<iostream> #include<vector> using namespace std; int main(){ int a,b; cin>>a>>b; vector<bool>tree(a+1,true); for(int i=0;i<b;++i){ int start,end; cin>>start>>end; for(int j=start;j<=end;++j){ tree[j]=false; } } int count=0; for(int i=0;i<=a;++i){ if(tree[i]){ count++; } } cout<<count<<endl; return 0; }