@[耀仔_502](/space/show?uid=144969)
希望更丰富的展现?[使用Markdown](https://www.luogu.org/wiki/show?name=%E5%B8%AE%E5%8A%A9%EF%BC%9Amarkdown)
by Smile_Cindy @ 2019-03-23 13:22:04
```cpp
#include<stdio.h>
int main()
{
int area,i,L,num=0;
int begin[3],end[3],trees[10001]; scanf("%d%d",&L,&area);
for(i=0;i<=L;i++)
trees[i]=0;
for(i=0;i<area;i++)
{
scanf("%d%d",&begin[i],&end[i]);
for(int j=0;j<=L;j++)
if(begin[i]<=j&&end[i]>=j)
trees[j]=1;
}
for(i=0;i<=L;i++)
if(trees[i]==0)
num++;
printf("%d",num);
return 0;
}
```
by 灵光一闪 @ 2019-03-23 13:27:10
写树状数组不就行了
by nofall @ 2019-03-23 13:34:17
我不懂为什么只有10分,明明编程没错
by 计算机黎嘉耀 @ 2019-03-23 13:54:49
@[咕咕咕自动机](/space/show?uid=118317) ......大佬这入门题
by Dawn_Sdy @ 2019-03-23 14:07:10
@[dxbdly](/space/show?uid=125443)
~~这是树状数组的入门题~~
by nofall @ 2019-03-23 14:10:15
@[咕咕咕自动机](/space/show?uid=118317) ......
by Dawn_Sdy @ 2019-03-24 13:53:01