| 记录编号 | 492792 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 973.[NOIP 2005]校门外的树 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.004 s | ||
| 提交时间 | 2018-03-27 20:11:14 | 内存使用 | 0.32 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
freopen("tsuri.in","r",stdin);
freopen("tsuri.out","w",stdout);
int L,M,s=0,x,y;
cin>>L>>M;
int t[10001];
for(int i=0;i<=L;i++){
t[i]=1;}
for(int i=1;i<=M;i++){
cin>>x>>y;
for(int j=x;j<=y;j++){
t[j]=0;
}
}
for(int i=0;i<=L;i++){
s+=t[i];
}
cout<<s;
return 0;
}