#include <iostream>
#include <map>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
map<int, int> mp;
for (int i = 0; i < n * m; i++)
{
int x;
cin >> x;
mp[x]++; //!!!!
}
int c=n*m/2;
map<int,int>::iterator it1;
for(it1=mp.begin();it1!=mp.end();it1++) //!!!!
{
if(it1->second==c)
{
cout<<it1->second<<endl; //!!!!
}
}
return 0;
}
Map统计元素的运用
最新推荐文章于 2024-09-02 16:35:28 发布