Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44189 | 惠子铭 | 校门外的树 | C++ | Accepted | 1 MS | 232 KB | 329 | 2024-03-29 15:16:44 |
#include<stdio.h> int main() { int a[10001]={0}; int L,M,l1,l2,c=0; scanf("%d%d",&L,&M); for(int i=1;i<=M;i++) { scanf("%d%d",&l1,&l2); for(int t=l1;t<=l2;t++) a[t]=1; } for(int i=0;i<=L;i++) if(a[i]==0) c++; printf("%d\n",c); return 0; }