CF707A.Brain's Photos
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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.
体型虽小但非常勇敢的老鼠 Brain 没能被少年反派暑期学校录取。他十分沮丧,决定暂缓征服世界的计划,转而成为一名摄影师。
众所周知,最酷的照片都拍摄在胶片上(因为你可以为这类照片打上标签 #film)。
Brain 用彩色胶片和黑白胶片拍摄了大量色彩缤纷的照片。随后,他将这些照片冲洗并转换为数字格式。但现在,彩色照片与黑白照片混杂在同一个文件夹中,要将它们分类整理,需要花费一个多小时!
由于 Brain 现在是一名摄影师,而非程序员,因此他请你帮忙判断一张照片究竟是彩色的还是黑白的。
每张照片可表示为一个大小为 n×m 的矩阵,矩阵中每个元素是一个字符,表示对应像素的颜色。总共只有 6 种颜色:
'C'(青色)'M'(品红色)'Y'(黄色)'W'(白色)'G'(灰色)'B'(黑色)
若一张照片仅包含白色、黑色和灰色像素,则该照片被视为黑白照片;若照片中包含任意青色、品红色或黄色像素,则该照片被视为彩色照片。
输入格式
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'.
输入的第一行包含两个整数 n 和 m(1 ≤ n, m ≤ 100),分别表示照片像素矩阵的行数和列数。
接下来是 n 行,每行描述矩阵的一行。每行包含 m 个由空格分隔的字符,用于描述该行中各像素的颜色。每行中的每个字符均为 'C'、'M'、'Y'、'W'、'G' 或 '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.
如果照片是黑白的,则输出 #Black&White(不带引号);如果照片是彩色的,则输出 #Color(不带引号),仅在一行中输出。
输入输出样例
输入#1
2 2 C M Y Y
输出#1
#Color
输入#2
3 2 W W W W B B
输出#2
#Black&White
输入#3
1 1 W
输出#3
#Black&White
输入解题思路,AI测评打分。不知道怎么写?