CF551A.GukiZ and Contest

普及/提高-

通过率:0%

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, nn students will attend, and before the start, every one of them has some positive integer rating. Students are indexed from 11 to nn . Let's denote the rating of ii -th student as aia_{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 AA has rating strictly lower then student BB , AA will get the strictly better position than BB , 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 nn ( 1<=n<=20001<=n<=2000 ), number of GukiZ's students.

The second line contains nn numbers a1,a2,... ana_{1},a_{2},...\ a_{n} ( 1<=ai<=20001<=a_{i}<=2000 ) where aia_{i} is the rating of ii -th student ( 1<=i<=n1<=i<=n ).

输出格式

In a single line, print the position after the end of the contest for each of nn 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 22 and 33 are positioned first (there is no other student with higher rating), and student 11 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 22 and 55 share the first position with highest rating, student 44 is next with third position, and students 11 and 33 are the last sharing fourth position.

首页