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 ...
随机推荐
- shell-script的简单举例
#!/bin/bash #defind the path PATH=/usr/local export PATH read -p "please input your first name: ...
- VS2013无法启动 IIS Express Web解决办法
开发环境:windows8.1+VS2013 使用VS2013有一段时间了,因前期都是编写C/S程序,没有使用到B/S调试器.前几日,创建了一个MVC项目,突然发现VS2013无法调试,报了这样的错. ...
- Jmeter实现登录bugfree、新建bug、解决bug脚本(抓包工具实现)
环境 Chrome jmeter3.1 fiddler4 win7 32位 Linux CentOs6.4 bugfree3.0.1 链接:http://pan.baidu.com/s/1gfHpbp ...
- python爬虫学习(10) —— 专利检索DEMO
这是一个稍微复杂的demo,它的功能如下: 输入专利号,下载对应的专利文档 输入关键词,下载所有相关的专利文档 0. 模块准备 首先是requests,这个就不说了,爬虫利器 其次是安装tessera ...
- 项目游戏开发日记 No.0x000006(Finish)
项目开发的最后一周! 突然一下就把游戏收尾了, 就像一个嘎然而止的乐章, 留下的, 是无尽的回味. 余音绕梁的夜晚, 也还想着, 拼命码代码的日子, 和还留在嘴里回味的烈酒的浓香. ————————— ...
- nginx配置
先在 cd /usr/local/nginx/conf 目录下找到 nginx.conf 文件 user www www; worker_processes 8; error_log /home/ww ...
- node fs lstat 如何区别文件和文件夹
通过lstat 得到 文件的描述对象 stat. stat.isFile() stat.isDirectory()
- ICP算法(Iterative Closest Point迭代最近点算法)
标签: 图像匹配ICP算法机器视觉 2015-12-01 21:09 2217人阅读 评论(0) 收藏 举报 分类: Computer Vision(27) 版权声明:本文为博主原创文章,未经博主允许 ...
- Extjs 下拉框显示远程数据
var store = new HT.SyncStore({ baseParams : { itemName : '绩效考核_任务状态' }, url : __ctxPath + '/system/l ...
- Gradle 下载
gradle各个版本的下载地址 :http://services.gradle.org/distributions 下载完后的gradle怎么使用呢? //下面是网上提供的方法,仅供学习参考 在 ht ...