HDU 1859
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std; typedef struct point
{
int x;
int y;
}PointType; int main()
{
vector<PointType> vecPoint; //存取全部输入用例
vector<int> vec_x, vec_y;
PointType Point;
while() //读取测试用例
{
scanf("%d %d",&Point.x, &Point.y);
if(Point.x == && Point.y == && vecPoint.size() > ) //如果输入点为(0,0) 样例输入结束
{
//查找最小长方形
//其实就是查找最小的(Xmin,Ymin) (Xmax,Ymax)
for( size_t it = ; it != vecPoint.size(); ++it)
{
vec_x.push_back(vecPoint[it].x);
vec_y.push_back(vecPoint[it].y);
}
//对vec_x vec_y进行排序
sort(vec_x.begin(), vec_x.end());
sort(vec_y.begin(), vec_y.end());
cout << vec_x[] <<" "<< vec_y[] <<" "<<vec_x[vec_x.size() - ] << " " << vec_y[vec_y.size() - ] << endl;
vecPoint.clear();
vec_x.clear();
vec_y.clear();
}
else if( Point.x == && Point.y == && vecPoint.size() == ) //存取测试用例
{
break;
}
else if(Point.x != || Point.y != )
vecPoint.push_back(Point);
}
}
HDU 1859的更多相关文章
- HDOJ(HDU) 1859 最小长方形(水题、、)
Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...
- hdu 1859 最小长方形
Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内. Input ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 5643 King's Game 打表
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember hi ...
- 转载:hdu 题目分类 (侵删)
转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
随机推荐
- win10打开IL DASM步骤:
- 3-linux下部署tomcat应用
linux下部署tomcat应用 相关软件下载 jdk http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downlo ...
- Jquery UI
jQuery UI简介 jQuery UI包含了许多维持状态的小部件(Widget),因此,它与典型的 jQuery 插件使用模式略有不同.所有的 jQuery UI 小部件(Widget)使用相同的 ...
- 初识WebService
一.什么是Web服务 Web服务是一种可以用来解决跨网络应用集成问题的开发模式,目的是保证不同平台的应用服务可以互操作 二.Web服务的三个核心 Soap: SOAP(Simple Object Ac ...
- webgl动画小测试
// MultiPoint.js (c) 2012 matsuda // Vertex shader program var VSHADER_SOURCE = 'attribute vec4 a_Po ...
- [LeetCode] Roman to Integer 罗马数字转化成整数
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...
- .NET程序员细数Oracle与众不同的那些奇葩点
扯淡 距上次接触 Oracle 数据库已经是 N 年前的事了,Oracle 的工作方式以及某些点很特别,那会就感觉,这货就是一个奇葩!最近重拾记忆,一直在折腾 Oracle,因为 Oracle 与众不 ...
- C#实现Levenshtein distance最小编辑距离算法
Levenshtein distance,中文名为最小编辑距离,其目的是找出两个字符串之间需要改动多少个字符后变成一致.该算法使用了动态规划的算法策略,该问题具备最优子结构,最小编辑距离包含子最小编辑 ...
- CentOS升级openssl
才设置了http2,结果蓝狗说我网站不安全,检测一下发现openssl有漏洞,于是准备升级一下openssl 检测网站: www.ssllabs.com/ssltest/analyze.html # ...
- 初步学习border-radius
1.属性解析 border-radius是css3属性,他可以使div的角进行一定程度的弯曲. 比如说下面这个width和height的正方形div 经过设置border-radius之后四个角会出现 ...