Akuna CapitalOA #18
Items Sort
估计简单可在线判题
Sort the values in ascending order of how often each value occurs in the whole array; ties in frequency are broken by ascending value. Equal values keep their original number of occurrences.
输入格式
The first line contains n; the second line contains n integers items[i]. This site follows the original constraints: 1≤n≤200000, 1≤items[i]≤1000000.
输出格式
Output the n sorted integers on one line, separated by spaces.
样例 1
输入:
6
4 5 6 5 4 3
输出:
3 6 4 4 5 5
样例 2
输入:
1
9
输出:
9
样例 3
输入:
6
4 4 4 2 2 3
输出:
3 2 2 4 4 4