0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 07:31:59 +00:00

P1097 统计数字

R39865694
This commit is contained in:
Baoshuo Ren 2020-10-15 21:11:36 +08:00 committed by Baoshuo Ren
parent bd5de06d06
commit 616e3b9faf
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

19
problem/P1097/P1097.cpp Normal file
View File

@ -0,0 +1,19 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
set<int> s;
map<int, int> m;
int n, t;
cin >> n;
while (n--) {
cin >> t;
s.insert(t);
m[t]++;
}
for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
cout << *it << ' ' << m[*it] << endl;
}
return 0;
}