Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133362 王丞杰 校门外的树 C++ Accepted 2 MS 316 KB 286 2025-10-18 15:53:01

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n,m,p,z,e=0; cin>>n>>m; int a[10000]; for(int i=0;i<=n;i++){ a[i] = 1; } while(m--){ cin>>p>>z; for(int j=p;j<=z;j++){ a[j] = 0; } } for(int i=0;i<=n;i++){ if(a[i]==1)e++; } cout<<e; }