map
2025-08-16 11:03:25
发布于:浙江
1阅读
0回复
0点赞
#include<map>
#include<iostream>
using namespace std;
map<int,int> bucket;
int main(){
int n;
cin>>n;
while(n--){
int x;
cin>>x;
bucket[x]++;
}
for (pair<int,int> paired:bucket){
cout<<paired.first<<' '<<paired.second<<'\n';
}
return 0;
}
这里空空如也
有帮助,赞一个