【PAT】1054. The Dominant Color
来源:互联网 发布:四川大学软件工程学院 编辑:程序博客网 时间:2024/06/05 20:31
#define LOCAL#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <string>#include <vector>#include <map>#include <set>using namespace std;int main(){ #ifdef LOCAL freopen("data.in","r",stdin); freopen("data.out","w",stdout); #endif // LOCAL int m,n; int ans=0; int cnt=0; scanf("%d%d",&m,&n); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ int x; scanf("%d",&x); if(cnt==0){ ans=x; }else if(ans==x){ cnt++; }else if(ans!=x){ cnt--; } } } printf("%d",ans); return 0;}
0 0
- PAT 1054. The Dominant Color
- PAT 1054. The Dominant Color
- 【PAT】1054. The Dominant Color
- PAT--1054. The Dominant Color
- 1054. The Dominant Color (20)-PAT
- PAT 1054. The Dominant Color (20)
- PAT (Advanced) 1054. The Dominant Color (20)
- PAT: 1054. The Dominant Color (20)
- PAT A 1054. The Dominant Color (20)
- PAT 1054. The Dominant Color (20)
- PAT 1054. The Dominant Color (20)
- PAT 1054. The Dominant Color (20)
- pat 1054. The Dominant Color (20)
- PAT 1054. The Dominant Color (20)
- 【PAT甲级】1054. The Dominant Color (20)
- 1054. The Dominant Color (20)PAT甲级
- PAT甲级1054. The Dominant Color (20)
- PAT-A-1054. The Dominant Color (20)
- Javascript核心基础浅析
- 2017年春节期间阅读清单
- react 单元测试,模拟操作后数据的变化
- (17)Spring Boot普通类调用bean【从零开始学Spring Boot】
- 新手入门——部署一个网站需要准备什么
- 【PAT】1054. The Dominant Color
- 关于Node.js后端架构的一点后知后觉
- C++学习记录一
- Linux shell 读取一个data文件,扫描其中的一个内容
- redis秒杀系统数据同步(保证不多卖)
- android Dialog无法获取窗口问题闪退
- map小结
- Spring MVC 开发小技巧收集(更新...)
- 10款常用的Linux音乐播放器