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

建议使用的浏览器:

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

3193:Find the hotel

题目描述
  Summer again! Flynn is ready for another tour around. Since the tour would take three or more days, it is important to find a hotel that meets for a reasonable price and gets as near as possible!
  But there are so many of them! Flynn gets tired to look for any. It’s your time now! Given the <pi, di> for a hotel hi, where pi stands for the price and di is the distance from the destination of this tour, you are going to find those hotels, that either with a lower price or lower distance. Consider hotel h1, if there is a hotel hi, with both lower price and lower distance, we would discard h1. To be more specific, you are going to find those hotels, where no other has both lower price and distance than it. And the comparison is strict.
输入解释
There are some cases. Process to the end of file.
Each case begin with N (1 <= N <= 10000), the number of the hotel.
The next N line gives the (pi, di) for the i-th hotel.
The number will be non-negative and less than 10000.
输出解释
First, output the number of the hotel you find, and from the next line, print them like the input( two numbers in one line). You should order them ascending first by price and break the same price by distance.
输入样例
3
15 10
10 15
8 9
输出样例
1
8 9
来自杭电HDUOJ的附加信息
Author ZSTU
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3193

最后修改于 2020-10-25T23:01:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)