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. 【BZOJ1977】[BeiJing2010组队]次小生成树 Tree 最小生成树+倍增

    [BZOJ1977][BeiJing2010组队]次小生成树 Tree Description 小 C 最近学了很多最小生成树的算法,Prim 算法.Kurskal 算法.消圈算法等等. 正当小 C ...

  2. SharePoint服务器端对象模型 之 访问网站和列表数据(Part 2)

    (二)列表(SPList) 列表是SharePoint中最为重要的数据容器,我们一般保存在SharePoint中的所有数据,都是保存在列表中(文档库也是一种列表),因此列表对象在SharePoint的 ...

  3. Java前端Rsa公钥加密,后端Rsa私钥解密(支持字符和中文)

    Base64工具类,可以让rsa编码的乱码变成一串字符序列 package com.utils; import java.io.ByteArrayInputStream; import java.io ...

  4. jquery遍历json与数组方法总结

    来自:http://www.php100.com/html/program/jquery/2013/0905/5927.html 先我们来参考each() 方法,each()规定为每个匹配元素规定运行 ...

  5. Beanutils-No origin bean specified问题分析

    copyProperties 时候系统中报错了,呵呵,源码已经说明了一切,就不BB了

  6. iOS响应超出View范围点击事件

    // 在view中重写以下方法,其中self.button就是那个希望被触发点击事件的按钮 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent ...

  7. 理解spring中的BeanFactory和FactoryBean的区别与联系

    原文地址:http://blog.csdn.net/joenqc/article/details/66479154 首先,这俩都是个接口… 实现 BeanFactory 接口的类表明此类事一个工厂,作 ...

  8. iOS开发之计算器

    本项目基于swift3.0的语法. // // ViewController.swift // 加法计算器 // // Created by 葛杨杨 on 2017/7/25. // Copyrigh ...

  9. 1.5 使用电脑测试MC20的发送英文短信功能

    需要准备的硬件 MC20开发板 1个 https://item.taobao.com/item.htm?id=562661881042 GSM/GPRS天线 1根 https://item.taoba ...

  10. QuickSort again

    I wrote a blog about Quick Sort before. Let's talk more about it. If you don't think that the implem ...