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 ...
随机推荐
- idea fect
idea facet 昨天从svn检查一个项目后,部署至tomcat服务器,启动成功,但实际代码其实没有进去, 因为该项目不是maven项目, artifacats是自己配的, 应该是这里弄错的. 最 ...
- OpenStack 企业私有云的若干需求(4):混合云支持 (Hybrid Cloud Support)
本系列会介绍OpenStack 企业私有云的几个需求: 自动扩展(Auto-scaling)支持 多租户和租户隔离 (multi-tenancy and tenancy isolation) 混合云( ...
- vs2013 error : cannot open source file "SDKDDKVer.h"
改: 项目属性--常规--工具集--Visual Studio 2013-WindowsXP(v120_xp)
- [No000083]文件与文件夹操作
#region Folder option 文件夹操作 /// <summary> /// 指定目录是否存在 /// </summary> /// <param name ...
- POJ 1637 Sightseeing tour
Sightseeing tour Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9276 Accepted: 3924 ...
- [LeetCode] Closest Binary Search Tree Value II 最近的二分搜索树的值之二
Given a non-empty binary search tree and a target value, find k values in the BST that are closest t ...
- C#进阶系列——WebApi 接口测试工具:WebApiTestClient
前言:这两天在整WebApi的服务,由于调用方是Android客户端,Android开发人员也不懂C#语法,API里面的接口也不能直接给他们看,没办法,只有整个详细一点的文档呗.由于接口个数有点多,每 ...
- Pairwise Sum and Divide 51nod
1305 Pairwise Sum and Divide 题目来源: HackerRank 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 收藏 关注 有这样 ...
- ie11的DOM管理器报错
IE11 Windows7下F12 DOC资源管理器不能用Exception in window.onload: Error: An error has ocurredJSPlugin.3005--- ...
- 利用StringEscapeUtils对字符串进行各种转义与反转义(Java)
apache工具包common-lang中有一个很有用的处理字符串的工具类,其中之一就是StringEscapeUtils,这个工具类是在2.3版本以上加上的去的,利用它能很方便的进行html,xml ...