编译器里报错,但可以A
#include<bits/stdc++.h> using namespace std; const int N=2e5+10; int n; map<int,int>m; int main(){ cin>>n; for(int i=1,ds;i<=n;i++){ cin>>ds; m[ds]++; } for(auto it=m.begin();it<m.end();++it){ cout<<it->first<<" "<<it->second<<"\n"; } }