标签:style blog http io ar color os sp for
1 500 3 150 300 100 200 470 471
298
#include<stdio.h>
#include<string.h>
int a[10002];
int main()
{
int test,i,m,n,ans,t,k;
scanf("%d",&test);
while(test--)
{
scanf("%d %d",&m,&n);
memset(a,0,sizeof(a));
while(n--)
{
scanf("%d%d",&t,&k);
for(i=t;i<=k;i++)
a[i]=1;
}
for(i=0,ans=0;i<=m;i++)
{
if(!a[i])
ans++;
}
printf("%d\n",ans);
}
return 0;
}
标签:style blog http io ar color os sp for
原文地址:http://blog.csdn.net/hdd871532887/article/details/41829269