Codeforces Round #511 (Div. 2) B. Cover Points

题解

题目大意 给n个二维坐标点 问在XY轴上画一个等腰三角形把所有点包含在内 问满足条件的最小等腰三角形的直角边长

AC代码

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;

int main()
{
#ifdef LOCAL
	//freopen("C:/input.txt", "r", stdin);
#endif
	int n, ans = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		ans = max(ans, a + b);
	}
	cout << ans << endl;

	return 0;
}

猜你喜欢

转载自blog.csdn.net/CaprYang/article/details/82809516