mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:52:02 +00:00
P1097 统计数字
R39865694
This commit is contained in:
parent
bd5de06d06
commit
616e3b9faf
19
problem/P1097/P1097.cpp
Normal file
19
problem/P1097/P1097.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user