chenxinhao0402 @ 2023-02-01 08:32:16
#include<cstdio>
using namespace std;
int main()
{
int l,m,tree[10010]={0},a,b,s=0;
memset(tree,0,sizeof(tree));
for (int i=0;i<m;i++)
{
scanf("%d%d",&a,&b);
for(int j=a;j<=b; j++)
tree[j]=1;
}
for(int i=0;i<=1,i++);
if(tree[i]==0)s++;
printf("%d",s);
return 0;
}
by chenxinhao0402 @ 2023-02-01 08:54:29
@The_Shadow_Dragon
by hzoi_Shadow @ 2023-02-01 08:56:08
@chenxinhao0402 把这段循环改成
for(int i=0;i<=1;i++)
if(tree[i]==0)s++;
for(int i=0;i<=l;i++)
if(tree[i]==0)s++;
by hzoi_Shadow @ 2023-02-01 08:56:37
@chenxinhao0402
by chenxinhao0402 @ 2023-02-01 08:59:26
AC了,谢谢各位