0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-05 12:38:47 +00:00
OI-codes/Luogu/P1097/P1097.cpp

20 lines
340 B
C++
Raw Normal View History

2020-10-15 13:11:36 +00:00
#include <bits/stdc++.h>
using namespace std;
int main() {
2021-11-19 09:01:13 +00:00
set<int> s;
2020-10-15 13:11:36 +00:00
map<int, int> m;
2021-11-19 09:01:13 +00:00
int n, t;
2020-10-15 13:11:36 +00:00
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;
}