Advertisement
konchin_shih

d885: NOIP2007 1.統計數字番外篇

Aug 6th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<map>
  3. #define endl '\n'
  4. using namespace std;
  5. int main() {
  6.     cin.tie(NULL);
  7.     ios::sync_with_stdio(false);
  8.     int n, t;
  9.     cin >> n;
  10.     map<int, int> m;
  11.     while (n--)
  12.         cin >> t, m[t]++;
  13.     for (const auto& [i, j] : m)
  14.         cout << i << ' ' << j << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement