POJ 2665 模拟,,

It is confirmed that these sections do not overlap with each other.

一句话 就变成水题了,,,

// by SiriusRen
#include <cstdio>
using namespace std;
int n,m,xx,yy;
int main(){
    while(scanf("%d%d",&n,&m)&&(n||m)){
        n++;
        for(int i=1;i<=m;i++)scanf("%d%d",&xx,&yy),n-=(yy-xx+1);
        printf("%d\n",n);
    }
}
posted @ 2016-07-28 14:58  SiriusRen  阅读(106)  评论(0编辑  收藏  举报