P1428 Little Fish Compare Cuteness
Description
Comparing people can drive you mad; comparing fish can be even harder on fish. A little fish recently entered a “cuteness contest,” where each fish is judged by its cuteness. The competing fish are arranged in a line from left to right, all facing left. Each fish is given an integer value that represents its cuteness. Clearly, the larger the integer, the cuter the fish, and the cuteness values of any two fish may be the same. Because all heads face left, each fish can see only the fish to its left. Each fish is mentally counting how many fish in its field of view are less cute than itself. Please help these cute but forgetful little fish compute this number.
Input Format
The first line contains a positive integer $n$, the number of fish.
The second line contains $n$ non-negative integers, separated by spaces, representing from left to right the cuteness $a_i$ of each fish.
Output Format
Output one line with $n$ integers, separated by spaces, representing from left to right, for each fish, how many fish to its left are less cute than itself.
Explanation/Hint
Constraints: For $100\%$ of the testdata, $1 \leq n \leq 100$, $0 \leq a_i \leq 10$.
Translated by ChatGPT 5