Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
38162 C++|刘一阳 校门外的树 C++ 通过 0 MS 268 KB 496 2024-01-25 15:21:38

Tests(1/1):


#include <iostream> using namespace std; int main() { int L,M; cin>>L>>M; bool trees[10001]; for (int i=0;i<=L;i++) { trees[i]=true; } for (int i=0;i<M;i++) { int start,end; cin >>start>>end; for (int j=start;j<=end;j++) { trees[j]=false; } } int count=0; for (int i=0;i<=L;i++) { if (trees[i]) { count++; } } cout<<count<<endl; return 0; }


测评信息: