Codeforces Round #368 (Div. 2) A Brain's Photos(水)
来源:互联网 发布:驾考预约软件 编辑:程序博客网 时间:2024/05/11 21:52
思路:水题
#include<bits/stdc++.h>using namespace std;int main(){int n,m,flag=0;scanf("%d%d",&n,&m);for(int i = 1;i<=n;i++)for(int j = 1;j<=m;j++){string s;cin >> s;if(s=="C" || s=="M" || s=="Y")flag=1;}if(flag) puts("#Color");elseputs("#Black&White");}
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.
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'.
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.
2 2C MY Y
#Color
3 2W WW WB B
#Black&White
1 1W
#Black&White
- 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
- 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(水)
- Codeforces #368 (Div.2)A.Brain's Photos【水题】
- Codeforces Round #368 (Div. 2) Brain's Photos
- 【Codeforces Round #368 (Div. 2)】Codeforces 707A Brain's Photos
- #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-707A. Brain's Photos
- 【codeforces 707A Brain's Photos】
- CodeForces 707 A. Brain's Photos
- 数据完整性约束
- zabbix配置问题
- 顺序表应用2:多余元素删除之建表算法
- hdu5787 数位dp
- struts学习遇到问题之一 action
- Codeforces Round #368 (Div. 2) A Brain's Photos(水)
- scrollview 包裹ListView recyclerview 为什么会不显示
- STL算法之移除性算法
- 字典树
- SDUT OJ 3377数据结构实验之查找五:平方之哈希表
- 免费下载电子书攻略
- Opencv Mat矩阵中data、size、depth、elemSize、step等属性的理解
- Comparable接口和Comparator接口的区别
- lightoj 1282 - Leading and Trailing (数学--log使用)