题目链接:

  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. PHP替换数据库的换行符

    //php 有三种方法来解决 //1.使用str_replace 来替换换行 $str = str_replace(array("\r\n", "\r", &q ...

  2. Axiom3D学习日记 5.Frame Listeners, and Input Handling

    Frame Listeners In Ogre's C++, we would register a class to receive notification before and after a ...

  3. java I/O的基本使用

    1.什么是I/O a.I/O也称为:输入输出,可以理解为In,Out b.I/O流:读取键盘键入的字符,硬盘上的文件 c.处理数据的类型分类:字节流.字符流 字节流:以Stream结尾的,可以处理图片 ...

  4. IsPostBack and DropdownList.

    Encounted the issue accident when helping my classmate dealing with his homework assignment,it turns ...

  5. SQLSERVER 触发器 将一个服务器上的数据库中数据插入到另一个服务器上的数据库中怎么做

    首先要执行 sp_addlinkedserver '服务器ip' 然后开始写语句 insert into ip.库名字.dbo.table select * from iserted

  6. 解决办法:CMake编译时出现“error in configuration process project files may be invalid”

    无论是CMake2.84 还是当前最新的CMake2.87都可能会出现这种错: 查遍国内外的网上都没有给出可行办法,结果还是自己解决了 现把出错原因和解决办法如下:出错原因:因是英文版本,通常安装没有 ...

  7. Array.prototype.map()

    mdn上解释的特别详细 概述 map() 方法返回一个由原数组中的每个元素调用一个指定方法后的返回值组成的新数组. 语法 array.map(callback[, thisArg]) 参数 callb ...

  8. javascript为目标标签添加class样式

    利用jQuery $("#目标id").addClass("加的class名字");

  9. Java多线程:常用的实现多线程的两种方式

    之所以说是常用的,是因为通过还可以通过java.util.concurrent包中的线程池来实现多线程.关于线程池的内容,我们以后会详细介绍;现在,先对的Thread和Runnable进行了解.本章内 ...

  10. jQuery在on绑定事件时,使用Function.prototype.bind上下文,只能用off(event)解绑函数,否则可能导致事件叠加

    因为一个bind函数,未解绑成功导致事件叠加,搞了一下午. keyup事件绑定: this.$document.on('keyup', this.keyUp.bind(this)); 原解绑函数: t ...