#B4094. Contestant Ranking in Simulated Informatics Competition
Contestant Ranking in Simulated Informatics Competition
Contestant Ranking in Simulated Informatics Competition
In this problem, you are given the scores of \(N\) contestants. Your task is to determine the rank of a specific contestant based on his score. The ranking system works as follows:
- The contestant(s) with the highest score receive rank 1.
- If multiple contestants have the same score, they share the same rank.
- The rank of any contestant is equal to one plus the number of contestants with a strictly higher score.
For example, if there are four contestants with scores \(50, 80, 50, 30\), then the contestant with score \(80\) is ranked 1st, both contestants with score \(50\) are ranked 2nd, and the contestant with score \(30\) is ranked 4th.
inputFormat
The input consists of three lines:
- The first line contains an integer \(N\) (\(1 \leq N \leq 10^5\)) representing the number of contestants.
- The second line contains \(N\) integers separated by spaces, representing the scores of the contestants.
- The third line contains an integer representing the score of the contestant whose rank is to be determined. It is guaranteed that this score appears in the list.
outputFormat
Output a single integer, which is the rank of the specified contestant based on the described ranking method.
sample
4
50 80 50 30
50
2