問題一覧 > 通常問題

No.504 Game Tournament (Ranking)

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 472
作問者 : kzyKT / テスター : Nafmo2
お気に入りにしたユーザー ProblemId : 1162 / 自分の提出
問題文最終更新日: 2026-06-25 03:46:33
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 161 (順位表) の他の問題:

Problem Statement

$K$ has come to a game tournament.
In this game, the goal is to get as high a score as possible.
$N$ people, including $K$, are participating.
They play $1$ time each in order, and the ranking is updated as they go.

$K$ plays first.
Find $K$'s rank at the moment each person finishes playing.
A higher score gives a higher rank.
In the case of a tie, the person who played earlier ranks higher.

Input

$N$
$a_0$
$a_1$
$\dots$
$a_{N-1}$

The $1$st line gives $N$.
The $2$nd and subsequent lines give each person's score $a_i$.
$a_0$ represents $K$'s score.

All input is given as integers.
$1 \le N \le 10^5$
$1 \le a_i \le 10^9$

Output

Output $K$'s rank at each point in time, over $N$ lines.

Sample

Sample 1
Input
3
2
3
1
Output
1
2
2

Sample 2
Input
6
1
1
4
5
1
4
Output
1
1
2
3
3
4

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。