tle
查看原帖
tle
1356594
zhenghaoHoney楼主2024/10/26 08:24
#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>

using namespace std;

const int N=3e5+10;
int n,f[N],s[N],mx=-1,ma;
int main(){
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>f[i]>>s[i];
	}
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			if(f[i]==f[j])
			{
				ma=s[i]+s[j]/2;;
			}
			else
			{	
				ma=s[i]+s[j];
			}
			mx=max(mx,ma);
		}
	}
	cout<<mx;
	return 0;
}
2024/10/26 08:24
加载中...