#C2556. Smaller Numbers Than Current

    ID: 45885 Type: Default 1000ms 256MiB

Smaller Numbers Than Current

Smaller Numbers Than Current

Given an integer array representing player scores, your task is to compute a new array where each element is the number of players having a strictly lower score than the corresponding element.

Formally, for each index \( i \), you need to compute:

\( result[i] = \#\{j \mid nums[j] < nums[i]\} \)

The input is provided via standard input and the output should be printed to standard output.

inputFormat

The first line contains an integer \( n \), the number of players. The second line contains \( n \) space-separated integers representing the scores of the players.

outputFormat

Output a single line with \( n \) space-separated integers. The \( i \)-th integer must be the count of players with a score strictly less than the \( i \)-th player's score.

## sample
5
8 1 2 2 3
4 0 1 1 3