建立 map<int, int> mp。
map<int, int> mp
每读入一个整数 x,执行:
x
mp[x]++;
其中:
mp[x]
map 会自动按照键从小到大保存元素,所以最后直接遍历即可按要求输出。
map
设不同整数的数量为 kkk。
使用您的 椰子OJ CoconutOJ 通用账户