CF551A.GukiZ and Contest
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Professor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepares. Now, he has decided to prepare a new contest.
In total, n students will attend, and before the start, every one of them has some positive integer rating. Students are indexed from 1 to n. Let's denote the rating of i-th student as a__i. After the contest ends, every student will end up with some positive integer position. GukiZ expects that his students will take places according to their ratings.
He thinks that each student will take place equal to
. In particular, if student A has rating strictly lower then student B, A will get the strictly better position than B, and if two students have equal ratings, they will share the same position.
GukiZ would like you to reconstruct the results by following his expectations. Help him and determine the position after the end of the contest for each of his students if everything goes as expected.
古基兹教授喜欢编程竞赛。他尤其喜欢对自己所出的竞赛中的学生进行评分。现在,他决定举办一场新的竞赛。
总共有 n 名学生参加,比赛开始前,每名学生都有一个正整数评分。学生编号为 1 到 n。记第 i 名学生的评分为 ai。比赛结束后,每名学生都将获得一个正整数名次。古基兹教授期望他的学生将按照各自的评分来决定名次。
他认为每名学生所获得的名次等于
。特别地,若学生 A 的评分严格小于学生 B 的评分,则 A 的名次严格优于 B;若两名学生的评分相等,则他们将并列同一名次。
古基兹教授希望你根据他的这一预期,还原出比赛结束后的最终成绩。请帮助他确定每名学生在比赛结束后的名次(假设一切均按其预期进行)。
输入格式
The first line contains integer n (1 ≤ n ≤ 2000), number of GukiZ's students.
The second line contains n numbers _a_1, _a_2, ... a__n (1 ≤ a__i ≤ 2000) where a__i is the rating of i-th student (1 ≤ i ≤ n).
第一行包含一个整数 n(1≤n≤2000),表示 GukiZ 的学生人数。
第二行包含 n 个数字 a1,a2,…,an(1≤ai≤2000),其中 ai 表示第 i 个学生的评分(1≤i≤n)。
输出格式
In a single line, print the position after the end of the contest for each of n students in the same order as they appear in the input.
在一行中,按输入中给出的顺序,输出每名学生的比赛结束后的最终排名。
输入输出样例
输入#1
3 1 3 3
输出#1
3 1 1
输入#2
1 1
输出#2
1
输入#3
5 3 5 3 4 5
输出#3
4 1 4 3 1
说明/提示
In the first sample, students 2 and 3 are positioned first (there is no other student with higher rating), and student 1 is positioned third since there are two students with higher rating.
In the second sample, first student is the only one on the contest.
In the third sample, students 2 and 5 share the first position with highest rating, student 4 is next with third position, and students 1 and 3 are the last sharing fourth position.
在第一个样例中,学生 2 和学生 3 排名第一(没有其他学生的评分更高),而学生 1 排名第三,因为有两名学生的评分更高。
在第二个样例中,第一名学生是比赛中唯一的学生。
在第三个样例中,学生 2 和学生 5 凭借最高评分并列第一;学生 4 紧随其后,排名第三;学生 1 和学生 3 并列最后,共享第四名。
输入解题思路,AI测评打分。不知道怎么写?