Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128815 罗安博 校门外的树 C++ Accepted 2 MS 304 KB 342 2025-08-20 10:25:34

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int a[100005]; int main(){ int l,m,b,c,s=0; cin>>l>>m; for(int j=0;j<=l;j++){ a[j]=1; } for(int i=1;i<=m;i++){ cin>>b>>c; for( b;b<=c;b++){ a[b]=0; } } for(int i=0;i<=l;i++){ if(a[i]==1){ s++; } } cout<<s; return 0; }