CodeForces - 1047B Cover Points
B. Cover Points
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
There are n points on the plane, (x1,y1),(x2,y2),…,(xn,yn).
You need to place an isosceles triangle with two sides on the coordinate axis to cover all points (a point is covered if it lies inside the triangle or on the side of the triangle). Calculate the minimum length of the shorter side of the triangle.
Input
First line contains one integer n (1≤n≤105).
Each of the next n lines contains two integers xi and yi (1≤xi,yi≤109).
Output
Print the minimum length of the shorter side of the triangle. It can be proved that it’s always an integer.
Examples
inputCopy
3
1 1
1 2
2 1
outputCopy
3
inputCopy
4
1 1
1 2
2 1
2 2
outputCopy
4
Note
Illustration for the first example:

Illustration for the second example:

题意是找一个三角形把所有点都覆盖,求等腰三角形最短边长。额他的长度因为是等腰直角三角型,很奇怪,最大的X+Y正好是最短边长。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a,b,max2=0;
cin>>n;
while(n--)
{
scanf("%d %d",&a,&b);
max2=max(a+b,max2);
}
cout<<max2<<endl;
return 0;
}
CodeForces - 1047B Cover Points的更多相关文章
- B. Cover Points Codeforces Round #511 (Div. 2)【数学】
题目: There are nn points on the plane, (x1,y1),(x2,y2),…,(xn,yn)(x1,y1),(x2,y2),…,(xn,yn). You need t ...
- codeforces 19D D. Points 树套树
D. Points Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/19/problem/D De ...
- codeforces B.Fixed Points
link:http://codeforces.com/contest/347/problem/B 很简单,最多只能交换一次,也就是说,最多会增加两个.可能会增加一个.也可能一个也不增加(此时都是fix ...
- codeforces 577E E. Points on Plane(构造+分块)
题目链接: E. Points on Plane time limit per test 2 seconds memory limit per test 256 megabytes input sta ...
- codeforces B. Fixed Points 解题报告
题目链接:http://codeforces.com/problemset/problem/347/B 题目意思:给出一个包含n个数的排列a,在排列a中最多只能作一次交换,使得ai = i 这样的匹配 ...
- codeforces 19 D. Points(线段树+set二分)
题目链接:http://codeforces.com/contest/19/problem/D 题意:给出3种操作:1)添加点(x,y),2)删除点(x,y),3)查询离(x,y)最近的右上方的点. ...
- Codeforces C Match Points(二分贪心)
题目描述: Match Points time limit per test 2 seconds memory limit per test 256 mega bytes input standard ...
- Codeforces 871C 872E Points, Lines and Ready-made Titles
题 OvO http://codeforces.com/contest/871/problem/C ( Codeforces Round #440 (Div. 1, based on Technocu ...
- CodeForces 1000C Covered Points Count(区间线段覆盖问题,差分)
https://codeforces.com/problemset/problem/1000/C 题意: 有n个线段,覆盖[li,ri],最后依次输出覆盖层数为1~n的点的个数. 思路: 区间线段覆盖 ...
随机推荐
- DVWA系列精品教程:2、命令注入
文章更新于:2020-04-11 注:如何搭建环境参见:搭建DVWA Web渗透测试靶场 DVWA之命令注入漏洞 一.介绍 1.1.官方说明 1.2.总结 二.命令注入实践 2.1.安全级别:LOW ...
- Unity Shader and Effects Cookbook问题记录
1.p61的specular计算,涉及到的一个参数“_SpecColor”是在Unity的官方cginc文件(UnityLightingCommon.cginc)中,是直接赋颜色给这个参数,反应到你模 ...
- Centos 7 系统定时重启
crontab -e //系统命令 00 08 * * * root systemctl restart docker00 08 * * * root reboot //写入需要重启的 ...
- 使用VirtualBox+Vagrant快速搭建Linux虚拟机环境
1. 软件准备 下载.安装Virtual Box https://www.virtualbox.org/wiki/Downloads 下载.安装Vagrant https://www.vagrantu ...
- 学会这项python技能,就再也不怕孩子偷偷打游戏了
前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:鸟哥 PS:如果想了解更多关于python的应用,可以私信小编,资料 ...
- V - Infinite Prefixes CodeForces - 1295B math
天哪!!菜到家啦. 数学+思维. 首先求出一个周期内cnt0-cnt1=c的个数,如果C=0,那么只要在一个周期内有前缀等于x,那么答案就是-1,否则答案就是0 如果C!=0,列一下方程x=t*c+a ...
- C. 无穷的小数
单点时限: 1.0 sec 内存限制: 512 MB 在十进制下,我们能够很轻易地判断一个小数的位数是有穷的或无穷的,但是把这个小数用二进制表示出的情况下其有穷性和无穷性就会发生改变,比如 十进制下的 ...
- gitbook命令
安装gitbook命令 前提:已经安装nodejs npm install -g gitbook-cli 查看版本号 gitbook -V gitbook命令 gitbook -h Usage: gi ...
- SpringBoot集成Shiro实现权限控制
Shiro简介 Apache Shiro是一个功能强大且易于使用的Java安全框架,用于执行身份验证,授权,加密和会话管理.使用Shiro易于理解的API,您可以快速轻松地保护任何应用程序-从最小的移 ...
- Netty入门与实战教程总结分享
前言:都说Netty是Java程序员必须要掌握的一项技能,带着不止要知其然还要知其所以然的目的,在慕课上找了一个学习Netty源码的教程,看了几章后着实有点懵逼.虽然用过Netty,并且在自己的个人网 ...