首页 > 其他 > 详细

POJ #2726 Holiday Hotel

时间:2018-01-24 20:56:46      阅读:195      评论:0      收藏:0      [点我收藏+]

Description


  

  Mr. and Mrs. Smith are going to the seaside for their holiday. Before they start off, they need to choose a hotel. They got a list of hotels from the Internet, and want to choose some candidate hotels which are cheap and close to the seashore. A candidate hotel M meets two requirements: 

Any hotel which is closer to the seashore than M will be more expensive than M.
Any hotel which is cheaper than M will be farther away from the seashore than M.

 

题意


 

  给出 n 对形如 (dist, cost) 的整数对,组成集合A,挑出其中 m 对,组成集合B,集合B中的元素需要满足如下条件:  

    一、if A[i].dist < B[j].dist , then A[i].cost > B[j].cost 

    二、if A[i].cost < B[j].cost , then A[i].dist > B[j].dist

    三、if A[i].dist == B[j].dist , then B[j].cost < A[i].cost, similar as A[i].cost == B[j].cost .  

 

INPUT


 

  头一行输入整数对的个数 N(1<= N <= 10000) ,之后的 N 行分别输入 N 对整数对 (dist, cost) 。

  输入 N = 0 时结束程序。

  技术分享图片

 

OUTPUT


 

  输出集合B中的元素个数 ,占一行。

  技术分享图片

 

思路


 

  待做  

POJ #2726 Holiday Hotel

原文:https://www.cnblogs.com/Bw98blogs/p/8343212.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!