为啥我WA声一片
代码:
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int c[a];
for(int i=0;i<a;i++)
{
c[i]=1;
}
for(int j=1;j<=b;j++)
{
int d,e;
cin>>d>>e;
for(int k=d;k<=e;k++)
{
c[k]=0;
}
}
int f;
for(int l=0;l<a+1;l++)
{
if(c[l]==1)
{
f++;
}
}
cout<<f;
return 0;
}