Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
48623 | menziyi | 校门外的树 | C++ | Accepted | 0 MS | 252 KB | 288 | 2024-06-09 18:08:26 |
#include<bits/stdc++.h> using namespace std; int main() { int L,n,a[10001]; cin>>L>>n; for(int i=0;i<=L;i++) a[i]=1; while(n--){ int l,r; cin>>l>>r; for(int i=l;i<=r;i++) a[i]=0; } int c=0; for(int i=0;i<=L;i++){ if(a[i]==1) c++; } cout<<c; return 0; }