1054 The Dominant Color (20 分)
Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A strictly dominant color takes more than half of the total area. Now given an image of resolution M by N (for example, 800×600), you are supposed to point out the strictly dominant color.

Input Specification:
Each input file contains one test case. For each case, the first line contains 2 positive numbers: M (≤800) and N (≤600) which are the resolutions of the image. Then N lines follow, each contains M digital colors in the range [0,2
​24
​​ ). It is guaranteed that the strictly dominant color exists for each input image. All the numbers in a line are separated by a space.

Output Specification:
For each test case, simply print the dominant color in a line.

Sample Input:
5 3

【PAT (Advanced Level) Practice】1054 The Dominant Color (20 分)相关推荐

  1. PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1011 World Cup Betting (20 分) 凌宸1642 题目描述: With the 2010 FIFA World Cu ...

  2. 【PAT (Advanced Level) Practice】1041 Be Unique (20 分)

    1041 Be Unique (20 分) Being unique is so important to people on Mars that even their lottery is desi ...

  3. 【PAT (Advanced Level) Practice】1050 String Subtraction (20 分)

    C/C++中整型数组的下标类型不一定为整型,C C++语言下数组性质与散列有些类似,即散列中的键值对:下标即为关键码,关键码通过散列函数映射得到元素即为值 下标可以为整型,也可以为字符型,简单案例如下 ...

  4. 【PAT (Advanced Level) Practice】1120 Friend Numbers (20 分)

    1120 Friend Numbers (20 分) Two integers are called "friend numbers" if they share the same ...

  5. PAT_(STL使用)map-1100 Mars Numbers (20分)-1054 The Dominant Color (20分)-1071-1022

    目录 1100 Mars Numbers (20分) 1054 The Dominant Color (20分) 1071 Speech Patterns (25分) 1022 Digital Lib ...

  6. 1054 The Dominant Color (20 分)_12行代码AC

    立志用最少的代码做最高效的表达 PAT甲级最优题解-->传送门 Behind the scenes in the computer's memory, color is always talke ...

  7. 【PAT (Advanced Level) Practice】1051 Pop Sequence (25 分)

    1051 Pop Sequence (25 分) Given a stack which can keep M numbers at most. Push N numbers in the order ...

  8. 【PAT (Advanced Level) Practice】1037 Magic Coupon (25 分)

    题意: 给出两个集合,从这两个集合里面选出数量相同的元素进行一对一相乘,求能够得到的最大乘积之和. 题解: 对每个集合,将正数和负数分开考虑,将每个集合里的整数从大到小排序:将每个集合里的负数从小到大 ...

  9. 【PAT甲级 找到出现次数过半的数字】1054 The Dominant Color (20 分) C++

    题目 思路 用数组模拟维护一个栈,栈内存储的数据有两个属性:数字.数量. 读取数字,如果数字已存在,相应位置上的数量+1 如果数字不存在,新建这个数字,size++,相应位置上的数量设置为1 题解 C ...

最新文章

  1. mysql left join,right join,inner join用法分析
  2. XamarinAndroid组件教程RecylerView适配器设置动画
  3. SAP中负号前置的函数:CLOI_PUT_SIGN_IN_FRONT
  4. linux mei swap,Linux swapoff命令
  5. HDU 2076 夹角有多大
  6. 52. yii create webapp
  7. Query ajax操作!!
  8. Spring开发指南_夏昕 问题总结
  9. centos 7.7.1908上隐藏顶栏和任务栏
  10. 浏览器事件 - 监听浏览器刷新问题及解决方案
  11. 【图像处理】基于灰度矩的亚像素边缘检测方法理论及MATLAB实现
  12. 隐蔽的大数据杀熟,“百亿补贴”会员竟比非会员贴得少?
  13. 网页地址栏?和的意义
  14. Activity的生命周期和启动模式
  15. 个人的第一个Chrome插件ColorConversion
  16. iOS中流媒体【视频】播放和下载【用到第三方的助手类】
  17. chmod命令优美的用法
  18. 一个测试岗面了 30 多人,100多个人投简历,真的太卷了,不能再真实了....
  19. 如何搭建“业务化”的指标体系?
  20. Mac下解锁网易云音乐灰色歌曲

热门文章

  1. MSB3721 命令““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe“ 已退出 返回代码为1
  2. python array笔记
  3. kmeans算法原理以及实践操作
  4. couldn't find native method
  5. 华为RH8100v3巡检
  6. linux系统的通讯工具,Linux下即时通讯工具:Pidgin 2.5.0正式发布了
  7. 梁体混凝土弹性模量计算_预应力混凝土连续梁多点转向顶推施工技术研究
  8. python 视频 灰度 伽玛_Python 图像处理实战 | 图像的灰度非线性变换之对数变换、伽马变换...
  9. vs调用matlab复杂,关于VS调用matlab的问题,求教大神
  10. 一文带你了解Spring核心接口Ordered的实现及应用