CodeForces-707A. Brain's Photos
来源:互联网 发布:死刑知乎 编辑:程序博客网 时间:2024/05/01 16:49
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.
Examples
input
2 2
C M
Y Y
output
#Color
input
3 2
W W
W W
B B
output
#Black&White
input
1 1
W
output
#Black&White
#include<iostream>using namespace std;int main(){ int n, m; char e; bool judge = false; cin >> n >> m; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) { cin >> e; if (!judge && (e == 'C' || e == 'M' || e == 'Y')) judge = true; } if (judge) cout << "#Color\n"; else cout << "#Black&White\n"; return 0;}
- 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
- codeforces 707 A. Brain's Photos
- codeforces--707A. Brain's Photos
- CodeForces 707A-Brain's Photos
- CodeForces 707A. Brain's Photos【字符串】
- Codeforces Problem 707A Brain's Photos(水题)
- 【CodeForces 707A】Brain's Photos(水)
- codeforces—— 707A —— Brain's Photos
- [codeforces]A - Brain's Photos 水题
- A. Brain's Photos
- Codeforce 707 A. Brain's Photos
- 【Codeforces Round #368 (Div. 2)】Codeforces 707A Brain's Photos
- [Leetcode]94. Binary Tree Inorder Traversal
- HTML canvas一些你可能忽视的自带属性
- 一周乱弹(1,摸态框增加纵向滚动条2,jQuery 鼠标点击事件3,通过ajax实现批量导出。4,windows查询占用某个端口号程序并杀死其进程)
- Java异常(一) Java异常简介及其架构
- EZ的间谍网络
- CodeForces-707A. Brain's Photos
- Listener
- Ubuntu 开机自动挂载Windows分区
- 【Linux系统编程】进程同步与互斥:System V 信号量
- 携程工作感言(四)(9.8)
- ros_Install _Kinetic
- ubuntu-anaconda-keras配置
- Linux makefile 教程 非常详细,且易懂
- Xcode7 错误提示:does not contain bitcode