超时!!求助!!
查看原帖
超时!!求助!!
1169115
copuqw9楼主2025/8/5 17:20
#include<bits/stdc++.h>
using namespace std;

int n,a,b,c[100000000],maxb;

int main()
{
	cin>>n; 
	for(int i=1; i<=n; i++)
	{
		cin>>a>>b;
		if(b>maxb)
		{
			maxb=b;
		}
		for(int j=a; j<=b; j++)
		{
			c[j]++;
		}
	}
	sort(c+1,c+maxb+1);
	cout<<c[maxb];
	return 0;
}
2025/8/5 17:20
加载中...