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

Brain‘s Photos

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 2C MY Y

Output

#Color

Input

3 2W WW WB B

Output

#Black&White

Input

1 1W

Output

#Black&White

题意:  太水了,都不想写了。。。

 1 # include <iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int n, m;
 6     char ch;
 7     cin >> n >> m;
 8     int flag = 0;
 9     for(int i = 0; i < n; i++)
10         for(int j = 0; j < m; j++)
11         {
12             cin >> ch;
13             if(ch == ‘C‘ || ch == ‘M‘ || ch == ‘Y‘)
14                 flag = 1;
15         }
16     if(flag)
17         cout << "#Color" << endl;
18     else
19         cout << "#Black&White" << endl;
20
21     return 0;
22 }

 

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

时间: 2024-04-18 10:56:08

Codeforces Round #368 (Div. 2) Brain's Photos的相关文章

Codeforces Round #368 (Div. 2)

A. Brain's Photos 题意: 给你一个n*m的字符矩阵,如果字符中出现'C', 'M', 'Y'这三个中的任何一个就输出"#Color";否则输出"#Black&White". 代码如下: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <fstream> 5 #include <ctime&

Codeforces Round #368 (Div. 2) ABCD

A. Brain's Photos 题解: 水得不要不要的 代码: #include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define se second #define fs first #define LL long long #define CLR(x) memset(x,0,sizeof x) #define MC(x,y) memcpy(x,y,sizeof(x)

Codeforces Round #368 (Div. 2) A

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

Codeforces Round #368 (Div. 2) Pythagorean Triples

Pythagorean Triples Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths

Codeforces Round #368 (Div. 2) C. Pythagorean Triples 数学

给定一个直角三角形的一边长度.问是否存在一个直角三角形,使得它满足有一边的长度是x 当x=1.2的时候是无解的,可以暴力打表看看. 注意到,相邻的两个数的平方的差值是奇数 x^2 - (x-1)^2 = 2*x-1 间隔为2的两个数的平方的差值是偶数 (x+1)^2 - (x-1)^2 = 4*x 这样就可以分类讨论了. 把n永远当成是指角边就OK #include <cstdio> #include <cstdlib> #include <cstring> #incl

Codeforces Round #368 (Div. 2) Bakery

Bakery Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities. To bake muffins in her bakery, Masha needs to establish flour supply

Codeforces 707 C. Pythagorean Triples(找规律)——Codeforces Round #368 (Div. 2)

传送门 Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths corresponding t

Codeforces Round #368 (Div. 2) B

Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities. To bake muffins in her bakery, Masha needs to establish flour su

Codeforces Round #368 (Div. 2) C

Description Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths corresp