faIIingsakura @ 2024-10-16 17:48:46
#include<stdio.h>
int main()
{
int L,m,j,a[2],b[10001],count=0,i;
scanf("%d%d",&L,&m);
for(i=0;i<m;i++)
{
for(j=0;j<2;j++)
scanf("%d",&a[j]);
for(j=0;j<=L;j++)
if(j>=a[0]&&j<=a[1])
b[j]=1;
}
for(i=0;i<=L;i++){
if(b[i]!=1)
count++;
}
printf("%d",count);
}
by jinzhiyun @ 2024-10-17 17:49:22
int L,m,j,a[2],b[10001],count=0,i;
int main()
{
写外面
}
by jinzhiyun @ 2024-10-17 17:49:41
@faIIingsakura