#ABC128B. Guidebook
Guidebook
题目描述
You have decided to write a book introducing good restaurants. There are restaurants that you want to introduce: Restaurant , Restaurant , , Restaurant . Restaurant is in city , and your assessment score of that restaurant on a -point scale is . No two restaurants have the same score.
You want to introduce the restaurants in the following order:
- The restaurants are arranged in lexicographical order of the names of their cities.
- If there are multiple restaurants in the same city, they are arranged in descending order of score.
Print the identification numbers of the restaurants in the order they are introduced in the book.
你决定写一本介绍好餐馆的书。您想介绍的餐厅有 家:餐厅 、餐厅 、 、餐厅 。餐厅 位于城市 ,您对该餐厅的 /分评估得分是 。没有两家餐厅的得分相同。
您希望按照以下顺序介绍这些餐馆:
- 餐厅按其城市名称的词典顺序排列。
- 如果同一城市有多家餐厅,则按得分降序排列。
按照书中介绍的顺序打印餐厅的标识号。
输入格式
输入内容按以下格式标准输入:
输出格式
打印 行。 ( )行应包含书中介绍的 ( )餐厅的标识号。
样例 #1
样例输入 #1
6
khabarovsk 20
moscow 10
kazan 50
kazan 35
moscow 60
khabarovsk 40
样例输出 #1
3
4
6
1
5
2
样例 #2
样例输入 #2
10
yakutsk 10
yakutsk 20
yakutsk 30
yakutsk 40
yakutsk 50
yakutsk 60
yakutsk 70
yakutsk 80
yakutsk 90
yakutsk 100
样例输出 #2
10
9
8
7
6
5
4
3
2
1
说明
数据规模与约定
- 是长度在 和 (含)之间的字符串,由小写英文字母组成。
- 是整数。
样例 解释
三个城市名称的词法顺序是卡赞
哈巴罗夫斯克} 莫斯科对每个城市的餐馆按得分从高到低的顺序进行介绍。因此,餐厅的介绍顺序为 。