PAT a1054题解
来源:互联网 发布:数据库编程语言 编辑:程序博客网 时间:2024/05/17 04:25
#include <cstdio>#include <map>using namespace std;int main(){int n, m, col;scanf("%d%d", &n, &m);map<int,int> count;for(int i = 0; i < n; i++){for(int j = 0; j < m; j++){scanf("%d", &col);if(count.find(col) != count.end()) count[col]++;else count[col] = 1;}}int k = 0, MAX = 0;for(map<int,int>::iterator it = count.begin(); it != count.end(); it++){if(it -> second > MAX){k = it -> first;MAX = it -> second;}}printf("%d\n", k);return 0;}
阅读全文
1 0
- PAT a1054题解
- PAT-A1054
- PAT-A1054. The Dominant Color (20)
- PAT A1054. The Dominant Color (20)
- PAT A1054 the dominent color (20)
- pat-a1054. The Dominant Color (20)
- STL--PAT.A1054. The Dominant Color (20)【map】
- PAT 1001-1010 题解
- PAT 1011-1020 题解
- PAT 1021-1030 题解
- PAT 1031-1040 题解
- PAT 1041-1050 题解
- PAT 1051-1060 题解
- PAT(basic level)题解
- PAT乙级题解
- PAT题解目录
- PAT甲级题解目录
- PAT乙级题解目录
- 第2章 渲染流水线
- PAT a1053题解
- 端口映射怎么设置
- Matlab如何真正自如的控制legend
- bzoj 3886: [Usaco2015 Jan]Moovie Mooving 状压dp
- PAT a1054题解
- 快速幂1003
- 电子书《程序原本》小述
- php 关联数组中随机的取出一个元素
- 关于网易公开课上南开数学文化的总结
- PAT a1055题解
- Service(远程服务)
- PAT a1056题解
- Matlab注释的几个方法