有木有大佬佬帮蒟蒻看看这题为什么会超时
查看原帖
有木有大佬佬帮蒟蒻看看这题为什么会超时
54413
WQMLL楼主2020/8/9 23:21
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int f[1001]={0};
	int l,n,a,b,s=0;
	cin>>l>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a>>b;
		for(int j=a;j<=b;j++)
		{
			f[j]=1;
		}
	}
	for(int i=0;i<=l;i++)
	{
		if(f[i]==0) s++;
	}
	cout<<s;
	return 0;
}
2020/8/9 23:21
加载中...