题目链接:

  http://codeforces.com/problemset/problem/707/A

题目大意:

  给一张N*M的图,只有六种颜色(如下),只含B,W,G的是黑白图,否则是彩色图。问这张图是什么图。

  • 'C' (cyan)
  • 'M' (magenta)
  • 'Y' (yellow)
  • 'W' (white)
  • 'G' (grey)
  • 'B' (black)

题目思路:

  【模拟】

  签到题。直接mark记一下是否出现彩色即可。

  1. //
  2. //by coolxxx
  3. //#include<bits/stdc++.h>
  4. #include<iostream>
  5. #include<algorithm>
  6. #include<string>
  7. #include<iomanip>
  8. #include<map>
  9. #include<memory.h>
  10. #include<time.h>
  11. #include<stdio.h>
  12. #include<stdlib.h>
  13. #include<string.h>
  14. //#include<stdbool.h>
  15. #include<math.h>
  16. #define min(a,b) ((a)<(b)?(a):(b))
  17. #define max(a,b) ((a)>(b)?(a):(b))
  18. #define abs(a) ((a)>0?(a):(-(a)))
  19. #define lowbit(a) (a&(-a))
  20. #define sqr(a) ((a)*(a))
  21. #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
  22. #define mem(a,b) memset(a,b,sizeof(a))
  23. #define eps (1e-8)
  24. #define J 10
  25. #define mod 1000000007
  26. #define MAX 0x7f7f7f7f
  27. #define PI 3.14159265358979323
  28. #define N 104
  29. using namespace std;
  30. typedef long long LL;
  31. int cas,cass;
  32. int n,m,lll,ans;
  33. char a[N][N];
  34. bool mark;
  35. int main()
  36. {
  37. #ifndef ONLINE_JUDGE
  38. // freopen("1.txt","r",stdin);
  39. // freopen("2.txt","w",stdout);
  40. #endif
  41. int i,j,k;
  42. // for(scanf("%d",&cas);cas;cas--)
  43. // for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
  44. // while(~scanf("%s",s+1))
  45. while(~scanf("%d",&n))
  46. {
  47. mark=;
  48. scanf("%d",&m);
  49. for(i=;i<=n;i++)
  50. {
  51. for(j=;j<=m;j++)
  52. {
  53. cin>>a[i][j];
  54. if(a[i][j]!='B' && a[i][j]!='W' && a[i][j]!='G')mark=;
  55. }
  56. }
  57. if(mark)puts("#Color");
  58. else puts("#Black&White");
  59. }
  60. return ;
  61. }
  62. /*
  63. //
  64.  
  65. //
  66. */

【模拟】Codeforces 707A Brain's Photos的更多相关文章

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

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

  2. CodeForces 707A Brain's Photos

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

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

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

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

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

  5. 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 ...

  6. 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 ...

  7. 水题 CodeForces 137A Postcards and photos

    题目传送门 /* 水! */ #include <cstdio> #include <cstring> #include <algorithm> using nam ...

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

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

  9. codeforces707A:Brain's Photos

    Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. ...

随机推荐

  1. Servlet创建、编译、部署、运行

    最近在做一个通过Servlet实现后台批量接收上传文件的东西,现将Servlet的开发.运行配置.调用记录下来.我们以最简单的FileUpload为例,目前所有的http协议相关的Servlet均继承 ...

  2. 'Service' object has no attribute 'process'

    在使用selenium+phantomjs时,运行总是出现错误信息: 'Service' object has no attribute 'process' 出现该错误的原因是未能找到可执行程序&qu ...

  3. 10.18 noip模拟试题

    分火腿 (hdogs.pas/.c/.cpp) 时间限制:1s:内存限制 64MB 题目描述: 小月言要过四岁生日了,她的妈妈为她准备了n根火腿,她想将这些火腿均分给m位小朋友,所以她可能需要切火腿. ...

  4. HTML设置固定页脚飘浮

    Css /* 页脚 */.footSty{bottom: 0pt; margin: 0pt; position: fixed; width: 100%; z-index: 10 ! important ...

  5. js分家效应

    (原创文章,转载请注明出处) 有继承,那么就有分家.让我们看以下例子. var parents = function(){ } parents.prototype.money = 200; var c ...

  6. Asp.net Mvc4 基于Authorize实现的模块访问权限

    在MVC中,我们可以通过在action或者controller上设置Authorize[Role="xxx"] 的方式来设置用户对action的访问权限.显然,这样并不能满足我们的 ...

  7. 实现HTTP跳转到HTTPS

    1 首先在您的网站下新建一个站点,名称随意,在属性中分配TCP端口为80,SSL不分配 然后在属性>主目录下配置 将此资源的内容来自: 改为 重定向到URL 然后重定向到中  输入:  HTTP ...

  8. 打造属于前端的Uri解析器

    今天和大家一起讨论一下如何打造一个属于前端的url参数解析器.如果你是一个Web开发工程师,如果你了解过后端开发语言,譬如:PHP,Java等,那么你对下面的代码应该不会陌生: $kw = $_GET ...

  9. iOS9 application:application openURL: sourceApplication: annotation: 方法不执行

    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url NS_DEPRECATED_IOS(2_0, 9 ...

  10. chrome调试状态下动态加载的js

    在js文件中加入 //@ sourceURL=文件名.js