1.冰雹猜想
#include<bits/stdc++.h>
using namespace std;
int main()
{int n,a[1002]={0},i=1;//i是记个数用的cin>>n;while(n!=1)//重点{a[i]=n;i++;if(n%2==0) n/=2;else n=3*n+1;}a[i]=1;//开始准备输出for(int j=i;j>=1;j--){cout<<a[j]<<' ';}return 0;
}
#include<cstdio>
int a[20000],m,x,y,sum,l;
int main(){scanf("%d %d",&l,&m);for(int i=1;i<=m;i++){scanf("%d %d",&x,&y);for(int i=x;i<=y;i++){a[i]=1;}}for(int i=0;i<=l;i++){if(a[i]==0){sum++;}}printf("%d",sum);return 0;
}