Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
37326 willson 校门外的树 C++ 解答错误 0 MS 256 KB 289 2024-01-20 10:49:59

Tests(0/1):


#include<bits/stdc++.h> using namespace std; int l,m,cnt=0,a[10010]; int main(){ cin>>l,m; while(m--){ int left,right; cin>>left,right; for(int i=left;i<=right;i++){ a[i]=1; } } for(int i=0;i<l;i++){ if(a[i]==0){ cnt++; } } cout<<cnt; return 0; }


测评信息:

输入

500 3
150 300
100 200
470 471

输出

500

答案

298

系统信息

exit code: 0, checker exit code: 0