PAT_1054. The Dominant Color
来源:互联网 发布:电子科技大学网络教育学费 编辑:程序博客网 时间:2024/06/05 14:43
//// main.cpp// PAT_1054. The Dominant Color//// Created by wjq on 17/5/15.// Copyright © 2017年 wjq. All rights reserved.//#include <iostream>#include <vector>#include <map>using namespace std;int N,M,temp;vector<int> v;map<int,int> m;int main(int argc, const char * argv[]){ cin>>N>>M; for(int i=0;i<N*M;i++) { cin>>temp; if(m.find(temp)==m.end()) m[temp]=1; else m[temp]++; v.push_back(temp); } for(int i=0;i<v.size();i++) { if(m[v[i]]>M*N/2) { cout<<v[i]; break; } } return 0;}
阅读全文
0 0
- PAT_1054: The Dominant Color
- PAT_1054. The Dominant Color
- The Dominant Color
- 1054. The Dominant Color
- 1054.The Dominant Color
- pat1054 The Dominant Color
- 1054. The Dominant Color
- 1054 The Dominant Color
- 1054. The Dominant Color
- The Dominant Color (20)
- 1054. The Dominant Color
- 1054. The Dominant Color
- The Dominant Color (20)
- A1054.The Dominant Color
- The Dominant Color
- The Dominant Color (20)
- PAT1054. The Dominant Color (20)
- pat 1054 The Dominant Color
- Problem : STL——字符串排序
- 【Linux】消息队列--实现进程间通信
- linux more
- tf.select的用法
- 工作流引擎Activiti学习第四天(六)--- 流程变量第一节
- PAT_1054. The Dominant Color
- C语言第七课 构造数据类型
- 动画的坑!!!!!
- shell下的定时任务
- 有时就一书--剑指offer
- 使用Visual Studio Code + Node.js搭建TypeScript开发环境
- Choco求解器的安装
- 动态规划问题
- Java的JOption函数进行用户交互