蓝桥杯 找到最多的数

#include <bits/stdc++.h>
using namespace std;
map<int,int>m1;
int main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int n,m;
  cin >> n >> m;
  for(int i=1;i<=n*m;++i)
  {
    int x;
    cin >> x;
    m1[x]++;
  }
  for(auto &[x,y] : m1)
  {
    if(2*y>n*m)
    cout << x << '\n';
  }
  return 0;
}
posted @ 2023-11-22 15:27  小姜吃小僵  阅读(46)  评论(0)    收藏  举报