[codeforces]A - Brain's Photos 水题
来源:互联网 发布:免费收支软件 编辑:程序博客网 时间:2024/05/02 00:17
Description
Small, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to become a photographer instead.
As you may know, the coolest photos are on the film (because you can specify the hashtag #film for such).
Brain took a lot of colourful pictures on colored and black-and-white film. Then he developed and translated it into a digital form. But now, color and black-and-white photos are in one folder, and to sort them, one needs to spend more than one hour!
As soon as Brain is a photographer not programmer now, he asks you to help him determine for a single photo whether it is colored or black-and-white.
Photo can be represented as a matrix sized n × m, and each element of the matrix stores a symbol indicating corresponding pixel color. There are only 6 colors:
- 'C' (cyan)
- 'M' (magenta)
- 'Y' (yellow)
- 'W' (white)
- 'G' (grey)
- 'B' (black)
The photo is considered black-and-white if it has only white, black and grey pixels in it. If there are any of cyan, magenta or yellow pixels in the photo then it is considered colored.
Input
The first line of the input contains two integers n and m (1 ≤ n, m ≤ 100) — the number of photo pixel matrix rows and columns respectively.
Then n lines describing matrix rows follow. Each of them contains m space-separated characters describing colors of pixels in a row. Each character in the line is one of the 'C', 'M', 'Y', 'W', 'G' or 'B'.
Output
Print the "#Black&White" (without quotes), if the photo is black-and-white and "#Color" (without quotes), if it is colored, in the only line.
Sample Input
2 2C MY Y
#Color
3 2W WW WB B
#Black&White
1 1W
#Black&White
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <algorithm>#include <climits>#include <cstring>#include <string>#include <set>#include <map>#include <queue>#include <stack>#include <vector>#include <list>#define rep(i,m,n) for(i=m;i<=n;i++)#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)const int inf_int = 2e9;const long long inf_ll = 2e18;#define inf_add 0x3f3f3f3f#define mod 10007#define vi vector<int>#define pb push_back#define mp make_pair#define fi first#define se second#define PI acos(-1.0)#define pii pair<int,int>#define Lson L, mid, rt<<1#define Rson mid+1, R, rt<<1|1const int maxn=5e2+10;using namespace std;typedef long long ll;typedef unsigned long long ull; inline int read(){int ra,fh;char rx;rx=getchar(),ra=0,fh=1;while((rx<'0'||rx>'9')&&rx!='-')rx=getchar();if(rx=='-')fh=-1,rx=getchar();while(rx>='0'&&rx<='9')ra*=10,ra+=rx-48,rx=getchar();return ra*fh;}//#pragma comment(linker, "/STACK:102400000,102400000")ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}int dir[4][2]={{1,0},{-1,0},{0,1},{0,-1}};int n,m;char temp[10];int main(){cin >> n>> m;for(int i=1;i<=n*m;i++){cin >> temp;if(!(temp[0]=='W'||temp[0]=='B'||temp[0]=='G')){cout<<"#Color"<<endl;return 0;}}cout<<"#Black&White"<<endl;return 0;}
- codeforces 707A Brain's Photos 【水题】
- [codeforces]A - Brain's Photos 水题
- Codeforces Problem 707A Brain's Photos(水题)
- Codeforces #368 (Div.2)A.Brain's Photos【水题】
- codeforces 707A - Brain's Photos
- 【模拟】Codeforces 707A Brain's Photos
- Codeforces 707A Brain‘s photos
- CodeForces-707A. Brain's Photos
- 【codeforces 707A Brain's Photos】
- CodeForces 707 A. Brain's Photos
- codeforces 707 A. Brain's Photos
- codeforces--707A. Brain's Photos
- CodeForces 707A-Brain's Photos
- CodeForces 707A. Brain's Photos【字符串】
- A. Brain's Photos
- Codeforces Round #368 (Div. 2) A Brain's Photos
- Codeforces Round #368 (Div. 2)(A. Brain's Photos)
- Codeforces Round #368(Div.2)A. Brain's Photos
- opencv3.0学习笔记【10/14】contrast、brught调节
- python学习笔记二
- opencv在vs2010中配置的错误
- 自己在看到网上一些table数据导出excel,自己为自己记录一下以免以后需要
- Java基本数据类型
- [codeforces]A - Brain's Photos 水题
- nodejs 新手问题汇总-不定期更新
- 数组中有两个出现一次的数字,其他数字都出现两次,找出这两个数字
- swift3.0调用相册
- linux下简单vim命令的练习使用
- Java Executor并发框架(十三)Executor框架线程池关于异常的处理
- (详细)Android启动模式 Intent属性详解
- 科大讯飞软件测试一面问题
- Android动画相关知识储备