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.

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>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
int n,m;
bool flag; inline int getint(){
int w=,q=;char c=getchar();
while(c!='-' && (c<'' || c>'')) c=getchar();
if(c=='-') q=-,c=getchar();
while(c>='' && c<='') w=w*+c-'',c=getchar();
return w*q;
} int main()
{
n=getint(); m=getint(); flag=false;
char c;
for(int i=;i<=n;i++)
for(int j=;j<=m;j++){
c=getchar();
while(c<'A' || c>'Z') c=getchar();
if(c!='W' && c!='B' && c!='G') flag=true;
}
if(flag) printf("#Color"); else printf("#Black&White");
return ;
}

codeforces707A:Brain's Photos的更多相关文章

  1. Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)

    Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...

  2. A. Brain's Photos ——Codeforces Round #368 (Div. 2)

    A. Brain's Photos time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  3. Codeforces Round #368 (Div. 2) A. Brain's Photos 水题

    A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very ...

  4. codeforces 707A A. Brain's Photos(水题)

    题目链接: A. Brain's Photos 题意: 问是黑白还是彩色; 思路: 没有思路: AC代码: #include <iostream> #include <cstdio& ...

  5. CodeForces 707A Brain's Photos (水题)

    题意:给一张照片的像素,让你来确定是黑白的还是彩色的. 析:很简单么,如果有一种颜色不是黑白灰,那么就一定是彩色的. 代码如下: #pragma comment(linker, "/STAC ...

  6. 【模拟】Codeforces 707A Brain's Photos

    题目链接: http://codeforces.com/problemset/problem/707/A 题目大意: 给一张N*M的图,只有六种颜色(如下),只含B,W,G的是黑白图,否则是彩色图.问 ...

  7. 【Codeforces 707A】Brain's Photos 水题

    黑白灰都是#Black&White #include <cstdio> int n,m; int main() { scanf("%d%d",&n,&a ...

  8. CodeForces 707A Brain's Photos

    简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...

  9. paper 29 :CV会议+领先研究室+专家+代码网址

    做机器视觉和图像处理方面的研究工作,最重要的两个问题:其一是要把握住国际上最前沿的内容:其二是所作工作要具备很高的实用背景.解决第一个问题的办法就是找出这个方向公认最高成就的几个超级专家(看看他们都在 ...

随机推荐

  1. 如何运行Python程序

    注:以下均基于windows下操作,并且安装的是最新的python3.3版本. 安装完python之后,我们可以做两件事情, 1.将安装目录中的Doc目录下的python331.chm使用手册复制到桌 ...

  2. JavaWeb 之邮件发送

    1. 邮件协议概述 SMTP(Simple Mail Transfer Protocol, 简单邮件传输协议) 发邮件协议; POP3(Post Office Protocol Version 3, ...

  3. zookeeper单机伪集群配置

    一.配置 1.在 opt 目录下建一个文件夹 zk,分别把zookeeper 安装包复制三份,命令为zookeeper-0  zookeeper_1  zookeeper_2 2.分别在每一个zook ...

  4. Thrift官方安装手册(译)

    本篇是Thrift官网安装文档的翻译,原地址点击这里.Thrift之前是不支持Windows的.但是似乎0.9版本以后已经支持Window了.介绍了Thrift安装的环境要求以及在centos,Deb ...

  5. open-falcon 前端代码在windows上运行

    1: 下载代码git clone https://github.com/open-falcon/dashboard.git 2:在代码\dashboard-0.2.0 的根目录下安装 python虚拟 ...

  6. 字符串之_strncat

    功能:将src的前n个字符添加到dest的后面 输入:dest,src,count 返回:ret #include <iostream> #include <assert.h> ...

  7. Mac 远程连接 Windows 系统无法全屏

    远程连接之后,Mac 工具栏中 配置 RDC 下 “首选项”. “显示” ----远程桌面大小:全屏 ----打开远程桌面窗口:第二显示器(我用的是双显示器,根据实际情况设定显示器) 配置完成后,点击 ...

  8. css字体样式

    css字体样式(Font Style) 属性       css文本样式 序号 中文说明 标记语法 1 字体样式 {font:font-style font-variant font-weight f ...

  9. python之路 正则表达式,模块导入的方法,hashlib加密

    一.正则表达式re python中re模块提供了正则表达式相关操作 字符: . 匹配除换行符以外的任意字符 \w 匹配字母或数字或下划线或汉字 \s 匹配任意的空白符 \d 匹配数字 \b 匹配单词的 ...

  10. iOS 52个技巧学习心得笔记 第二章 对象 , 消息, 运行期

    1. 属性 在开发过程中经常要用到定义属性,@property和@synthesize是经常用到的属性, property在.h文件中作声明,@synthesize在.m文件中用于实现 // Stud ...