Coordinate Compression
Time limit2sMemory limit512 MB
For each of N coordinates, output the number of distinct values smaller than it, which is its rank under coordinate compression.
- Level
Medium4 of 10
- Topics
- Sorting, Hash map, Array, Binary search
- Solved
- No attempts yet
Problem
There are coordinates on the number line. We want to apply coordinate compression to these coordinates.
The compressed value of must equal the number of distinct coordinates satisfying .
Print , the result of applying coordinate compression to .
Input
The first line gives .
The second line gives , separated by single spaces.
Output
On the first line, print , separated by single spaces.