码迷,mamicode.com
首页 > 其他好文 > 详细

POJ #2726 Holiday Hotel

时间:2018-01-24 22:29:51      阅读:322      评论:0      收藏:0      [点我收藏+]

标签:结束   internet   分享图片   list   int   poj   元素   题意   ida   

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

标签:结束   internet   分享图片   list   int   poj   元素   题意   ida   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!