【模拟】Codeforces 707A Brain's Photos
题目链接:
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记一下是否出现彩色即可。
- //
- //by coolxxx
- //#include<bits/stdc++.h>
- #include<iostream>
- #include<algorithm>
- #include<string>
- #include<iomanip>
- #include<map>
- #include<memory.h>
- #include<time.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- //#include<stdbool.h>
- #include<math.h>
- #define min(a,b) ((a)<(b)?(a):(b))
- #define max(a,b) ((a)>(b)?(a):(b))
- #define abs(a) ((a)>0?(a):(-(a)))
- #define lowbit(a) (a&(-a))
- #define sqr(a) ((a)*(a))
- #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
- #define mem(a,b) memset(a,b,sizeof(a))
- #define eps (1e-8)
- #define J 10
- #define mod 1000000007
- #define MAX 0x7f7f7f7f
- #define PI 3.14159265358979323
- #define N 104
- using namespace std;
- typedef long long LL;
- int cas,cass;
- int n,m,lll,ans;
- char a[N][N];
- bool mark;
- int main()
- {
- #ifndef ONLINE_JUDGE
- // freopen("1.txt","r",stdin);
- // freopen("2.txt","w",stdout);
- #endif
- int i,j,k;
- // for(scanf("%d",&cas);cas;cas--)
- // for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
- // while(~scanf("%s",s+1))
- while(~scanf("%d",&n))
- {
- mark=;
- scanf("%d",&m);
- for(i=;i<=n;i++)
- {
- for(j=;j<=m;j++)
- {
- cin>>a[i][j];
- if(a[i][j]!='B' && a[i][j]!='W' && a[i][j]!='G')mark=;
- }
- }
- if(mark)puts("#Color");
- else puts("#Black&White");
- }
- return ;
- }
- /*
- //
- //
- */
【模拟】Codeforces 707A Brain's Photos的更多相关文章
- CodeForces 707A Brain's Photos (水题)
题意:给一张照片的像素,让你来确定是黑白的还是彩色的. 析:很简单么,如果有一种颜色不是黑白灰,那么就一定是彩色的. 代码如下: #pragma comment(linker, "/STAC ...
- CodeForces 707A Brain's Photos
简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...
- codeforces 707A A. Brain's Photos(水题)
题目链接: A. Brain's Photos 题意: 问是黑白还是彩色; 思路: 没有思路: AC代码: #include <iostream> #include <cstdio& ...
- Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)
Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...
- 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 ...
- 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 ...
- 水题 CodeForces 137A Postcards and photos
题目传送门 /* 水! */ #include <cstdio> #include <cstring> #include <algorithm> using nam ...
- 【Codeforces 707A】Brain's Photos 水题
黑白灰都是#Black&White #include <cstdio> int n,m; int main() { scanf("%d%d",&n,&a ...
- codeforces707A:Brain's Photos
Description Small, but very brave, mouse Brain was not accepted to summer school of young villains. ...
随机推荐
- PHP替换数据库的换行符
//php 有三种方法来解决 //1.使用str_replace 来替换换行 $str = str_replace(array("\r\n", "\r", &q ...
- 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 ...
- java I/O的基本使用
1.什么是I/O a.I/O也称为:输入输出,可以理解为In,Out b.I/O流:读取键盘键入的字符,硬盘上的文件 c.处理数据的类型分类:字节流.字符流 字节流:以Stream结尾的,可以处理图片 ...
- IsPostBack and DropdownList.
Encounted the issue accident when helping my classmate dealing with his homework assignment,it turns ...
- SQLSERVER 触发器 将一个服务器上的数据库中数据插入到另一个服务器上的数据库中怎么做
首先要执行 sp_addlinkedserver '服务器ip' 然后开始写语句 insert into ip.库名字.dbo.table select * from iserted
- 解决办法:CMake编译时出现“error in configuration process project files may be invalid”
无论是CMake2.84 还是当前最新的CMake2.87都可能会出现这种错: 查遍国内外的网上都没有给出可行办法,结果还是自己解决了 现把出错原因和解决办法如下:出错原因:因是英文版本,通常安装没有 ...
- Array.prototype.map()
mdn上解释的特别详细 概述 map() 方法返回一个由原数组中的每个元素调用一个指定方法后的返回值组成的新数组. 语法 array.map(callback[, thisArg]) 参数 callb ...
- javascript为目标标签添加class样式
利用jQuery $("#目标id").addClass("加的class名字");
- Java多线程:常用的实现多线程的两种方式
之所以说是常用的,是因为通过还可以通过java.util.concurrent包中的线程池来实现多线程.关于线程池的内容,我们以后会详细介绍;现在,先对的Thread和Runnable进行了解.本章内 ...
- jQuery在on绑定事件时,使用Function.prototype.bind上下文,只能用off(event)解绑函数,否则可能导致事件叠加
因为一个bind函数,未解绑成功导致事件叠加,搞了一下午. keyup事件绑定: this.$document.on('keyup', this.keyUp.bind(this)); 原解绑函数: t ...