#P8832. [传智杯 #3 初赛] 志愿者
[传智杯 #3 初赛] 志愿者
Description
Chuanzhi Advanced Institute has recruited a total of volunteers to take charge of cleaning activities. Now you need to help count each volunteer’s work status, so that an honor roll can be made and little flowers can be given to them.
The -th volunteer has a working time and a difficulty coefficient for the work they are responsible for. A volunteer’s contribution can be determined by .
Now you need to sort these volunteers by contribution from high to low. For volunteers with the same contribution, the one with a longer working time should be ranked first. If both contribution and working time are the same, the volunteer with the smaller index should be ranked first.
Input Format
The first line contains one integer , the number of volunteers.
The next lines each contain two integers separated by spaces, representing the working time and difficulty coefficient of the -th volunteer.
Output Format
Output one line with integers. The -th integer is the index of the volunteer ranked -th. Indices start from .
Note that the time limit of this problem is 5 s, and the input/output size is large. Please pay attention to the impact of constant factors on time usage. We will not give extra running time to contestants using Java and Python.
3
1 2
2 3
3 4
3 2 1
Hint
For of the testdata, .
For an additional of the testdata, .
For of the testdata, , .
However, since this contest uses the ACM rules, you must pass of the testdata to get the score for this problem, and the same applies to the following problems.
Translated by ChatGPT 5
京公网安备 11011102002149号