#4781. Standings
Standings
Standings
题目描述
people numbered through tossed a coin several times. We know that person 's tosses resulted in heads and tails. Person 's success rate of the tosses is defined by . Sort people in descending order of their success rates, with ties broken in ascending order of their assigned numbers.
输入格式
The input is given from Standard Input in the following format:
输出格式
Print the numbers of people in descending order of their success rates, with ties broken in ascending order of their assigned numbers.
3
1 3
3 1
2 2
2 3 1
2
1 3
2 6
1 2
4
999999999 1000000000
333333333 999999999
1000000000 999999997
999999998 1000000000
3 1 4 2
提示
All input values are integers.Person 's success rate is , person 's is , and person 's is .
Sort them in descending order of their success rates to obtain the order in Sample Output.
Note that person and should be printed in ascending order of their numbers, as they have the same success rates.
标签: AtCoder|abc308C
来源
AtCoder|abc308C