POJ 2665 模拟,,

来源:互联网 发布:mac系统星际2打不开 编辑:程序博客网 时间:2024/06/16 18:13

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);    }}
0 0