2 条题解
-
0Guest
-
2
# include<bits/stdc++.h> using namespace std; map<int,int> m; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ int x; cin>>x; auto t=m.find(x); if(t!=m.end()){ t->second++; } else{ m.insert(make_pair(x,1)); } } for(auto t=m.begin();t!=m.end();t++){ cout<<t->first<<" "<<t->second<<endl; } return 0; }
信息
- ID
- 246
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 5
- 标签
- 递交数
- 24
- 已通过
- 13
- 上传者