Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
37323 | ☩Deutschland☩ | 校门外的树 | C++ | Accepted | 0 MS | 264 KB | 299 | 2024-01-20 10:45:39 |
#include<bits/stdc++.h> using namespace std; int a[10010]; int l,m,cnt; 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; }