标签:++ 技术总结 scanf mina name return include pre 直接
#include<iostream>
#include<map>
using namespace std;
int main(){
int m, n;
scanf("%d %d", &m, &n);
map<int, int> count;
int half;
half = m * n / 2;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
int temp;
scanf("%d", &temp);
count[temp]++;
if(count[temp] > half){
printf("%d", temp);
return 0;
}
}
}
return 0;
}
A1054 The Dominant Color (20分)
标签:++ 技术总结 scanf mina name return include pre 直接
原文地址:https://www.cnblogs.com/tsruixi/p/12245500.html