当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2726:Holiday Hotel

题目描述
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:
  1. Any hotel which is closer to the seashore than M will be more expensive than M.
  2. Any hotel which is cheaper than M will be farther away from the seashore than M.

输入解释
There are several test cases. The first line of each test case is an integer N (1 <= N <= 10000), which is the number of hotels. Each of the following N lines describes a hotel, containing two integers D and C (1 <= D, C <= 10000). D means the distance from the hotel to the seashore, and C means the cost of staying in the hotel. You can assume that there are no two hotels with the same D and C. A test case with N = 0 ends the input, and should not be processed.
输出解释
For each test case, you should output one line containing an integer, which is the number of all the candidate hotels.
输入样例
5
300 100
100 300
400 200
200 400
100 500
0
输出样例
2

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Beijing 2005

源链接: POJ-2726

最后修改于 2020-10-29T06:40:40+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536