//poj 2665 小学生题 种树题
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main()
{
int n, m;
cin>>n;
cin>>m;
while( n != 0 && m != 0)
{
int start, end;
n = n+1;
for(int i = 0; i < m; i++)
{
cin>>start>>end;
n -= (end - start + 1);
}
cout<<n<<endl;
cin>>n;
cin>>m;
}
return 0;
}
poj 2665
最新推荐文章于 2018-03-09 14:48:53 发布