Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44103 | lnx | 校门外的树 | C++ | Accepted | 0 MS | 248 KB | 316 | 2024-03-29 14:50:47 |
#include<iostream> using namespace std; int main() { int l,m; cin>>l>>m; int a[m],b[m]; int x=0; for(int i=0;i<m;i++) cin>>a[i]>>b[i]; for(int j=0;j<=l;j++) { for(int k=0;k<m;k++) { if(j<=b[k]&&j>=a[k]) { x++; break; } } } int y=l+1-x; cout<<y; return 0; }