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 ...
随机推荐
- laravel框架中容器类简化代码-摘自某书
<?php //容器类装实例或提供实例的回调函数 class Container { protected $bindings = []; //绑定接口和生成相应实例的回调函数 public fu ...
- WPF 自定义DateControl DateTime控件
自定义日期控件,月份选择.如下是日期的一些效果图. 具体的样式.颜色可以根据下面的代码,自己调节即可 1.日期控件的界面 <UserControl x:Class="WpfApp ...
- 项目游戏开发日记 No.0x000006(Finish)
项目开发的最后一周! 突然一下就把游戏收尾了, 就像一个嘎然而止的乐章, 留下的, 是无尽的回味. 余音绕梁的夜晚, 也还想着, 拼命码代码的日子, 和还留在嘴里回味的烈酒的浓香. ————————— ...
- Favorites of top 10 rules for success
Dec. 31, 2015 Stayed up to last minute of 2015, 12:00am, watching a few of videos about top 10 rules ...
- Salesforce Apex页面中调用远端网络服务
本文介绍了Salesforce Apex页面中调用远端网络服务的实现过程. ### 注册远端网络服务 在使用Apex代码调用远端网络服务之前,首先需要在Salesforce中注册远端网络服务地址, 本 ...
- hibernate三种状态
转自:http://www.cnblogs.com/xiaoluo501395377/p/3380270.html 学过hibernate的人都可能都知道hibernate有三种状态,transien ...
- Sqlite3常用的插入方法及性能测试
最近做到的项目涉及一个大数据量缓存重传,其中要用到的sqlite技术,把自己的学习心得整理了一下. SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它包含在一个相对小的C库中. ...
- vim修改文字编码
在Vim中查看文件编码 :set fileencoding 即可显示文件编码格式.如果你只是想查看其它编码格式的文件或者想解决 用Vim查看文件乱码的问题,那么在~/.vimrc 文件中添加以下内容: ...
- DeepMind背后的人工智能:深度学习原理初探
去年11月,一篇名为<Playing Atari with Deep Reinforcement Learning>的文章被初创人工智能公司DeepMind的员工上传到了arXiv网站.两 ...
- StarUML license key
参考博客:http://blog.csdn.net/Excing/article/details/48998891 方法 将StarUML/www/license/node/LicenseManage ...