1054. The Dominant Color (20)
来源:互联网 发布:迅龙数据恢复怎么用 编辑:程序博客网 时间:2024/05/21 13:40
1054. The Dominant Color (20)
#include <stdio.h>#include <map>using namespace std;class CA{public:void run();map<int,int> cols;};void CA::run(){int m,n,mn,hmn,t;scanf("%d%d",&m,&n);mn=m*n;hmn=mn/2;map<int,int>::iterator im;while(mn-->0){scanf("%d",&t);im=cols.find(t);if(im!=cols.end()){cols[t]++;}else{cols[t]=1;}if(cols[t]>hmn){printf("%d\n",t);return;}}}int main(){//freopen("test.in","r",stdin);CA *a=new CA;a->run();return 0;}
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 1054. The Dominant Color (20)
- 使用 JMeter 进行 HTTP 负载测试
- Git hub pull时候的错误 : The current branch is not configured for pull No value for key branch.master.mer
- 1053. Path of Equal Weight (30)
- 2013-11-25-安装SVN代码管理工具
- 国内HTML5前端开发框架汇总
- 1054. The Dominant Color (20)
- 别动辄降级论:互联网很伟大 从业者很平凡
- Properties类的使用
- 1055. The World's Richest (25)
- sql语句中字段的别名中含有括号时的解决办法
- Selenium 元素定位(4)
- Linux的socket网络编程
- Linux下时间格式转换
- 万能hibernate修改法