302843: CF551A. GukiZ and Contest
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
GukiZ and Contest
题意翻译
GukiZ 喜欢 OI,也喜欢出毒瘤题。他喜欢根据比赛的成绩为选手计算 rating。他现在正在准备一套新的毒瘤题。 一共有 $n$ 名选手被骗来做他的毒瘤题,每一位选手有一个正的 rating。选手们的编号为 $1$ 到 $n$。第 $i$ 名选手的 rating 是 $a_{i}$。比赛还没有开始,GukiZ 开始预测比赛结果。 GukiZ 认为,每名选手的排名应该是 $1 + G$,其中 $G$ 表示 rating 严格比这名选手大的选手数量。也就是说,如果选手 A 的 rating 严格比选手 B 高,他的排名就一定在 B 之上;如果两名选手 rating 相同,那么他们就一定会并列。 然而这件事情几乎不可能发生,但 GukiZ 依然想知道根据他的想法,每名选手的排名。 输入格式 输入的第一行包含一个整数 $n$,表示这场比赛的选手数量。 输入的第二行包含 $n$ 个整数 $a_i$ ($1\le a_i\le 2000$),第 $i$ 个整数表示第 $i$ 名选手的 rating。 输出格式 输出一行 $n$ 个整数,表示他们的理论排名。 样例解释 1 $2$ 号选手和 $3$ 号选手是第一名(因为没有选手 rating 比他们高),$1$ 号选手第三名(因为两名选手 rating 比他高)。题目描述
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 ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF551A/57ba0d4ba47944032501d156e0c39e7885be94b6.png). 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.输入输出格式
输入格式
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 $ ).
输出格式
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