求纠错
查看原帖
求纠错
1142056
jnxx_liyanze楼主2023/12/21 23:12
#include<iostream>
using namespace std;
int tree[10010]={0};
int main(){
	int l,m,a,b,s=0;
	cin>>l>>m;
	for(int i=0;i<m;i++){
		cin >> a >> b;
		for(int j=a;j<=b;j++)
			tree[j]=1;
	}
	for(int i=0;i<=1;i++)
		if(tree[i]==0)
			s++;
	cout<<s<<endl;
	return (0);
}
2023/12/21 23:12
加载中...