QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB

#23925. Marathon Race

统计

問題文

JOI 高校には N 人の生徒がおり,1 から N までの番号が付けられている.

先月 JOI 高校ではマラソン大会が開催され,生徒全員がこれに参加した.生徒 i (1 ≦ i ≦ N) の記録は Ai 分であった.

マラソン大会における各生徒の順位を求めよ.ただし,生徒 i (1 ≦ i ≦ N) の順位は,(記録が Ai 分未満の生徒の人数)+ 1 で計算される.

制約

  • 1 ≦ N ≦ 100.
  • 1 ≦ Ai≦ 1 000 (1 ≦ i ≦ N).
  • 入力される値はすべて整数である.

入力

入力は以下の形式で与えられる.
N
A1 A2 … AN

出力

N 行出力せよ.i 行目 (1 ≦ i ≦ N) には,生徒 i の順位を出力せよ.


入力例 1

3
44 42 69

出力例 1

2
1
3
  • 生徒 1 の記録は 44 分である.記録が 44 分未満の生徒は 1 人いるので,生徒 1 の順位は 2 位である.したがって,1 行目には 2 を出力する.
  • 生徒 2 の記録は 42 分である.記録が 42 分未満の生徒はいないので,生徒 2 の順位は 1 位である.したがって,2 行目には 1 を出力する.
  • 生徒 3 の記録は 69 分である.記録が 69 分未満の生徒は 2 人いるので,生徒 3 の順位は 3 位である.したがって,3 行目には 3 を出力する.

入力例 2

4
40 60 40 60

出力例 2

1
3
1
3
  • 生徒 1 の記録は 40 分である.記録が 40 分未満の生徒はいないので,生徒 1 の順位は 1 位である.したがって,1 行目には 1 を出力する.
  • 生徒 2 の記録は 60 分である.記録が 60 分未満の生徒は 2 人いるので,生徒 2 の順位は 3 位である.したがって,2 行目には 3 を出力する.
  • 生徒 3 の記録は 40 分である.記録が 40 分未満の生徒はいないので,生徒 3 の順位は 1 位である.したがって,3 行目には 1 を出力する.
  • 生徒 4 の記録は 60 分である.記録が 60 分未満の生徒は 2 人いるので,生徒 4 の順位は 3 位である.したがって,4 行目には 3 を出力する.

入力例 3

10
766 152 595 926 663 509 368 595 175 622

出力例 3

9
1
5
10
8
4
3
5
2
7

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.