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

PS9.8日做了但是忘了发博客,所以坚持3天了呦~

终于读懂了这个题了,心累

Describe:
  给你8 * 8的棋盘摆放问题,行的顺序可能是错乱的,问给你的8行是否能组成棋盘

Solution:
  所以我们要检查的就是

  1.棋盘有没有相邻的颜色相同

  2.开头必须得是4 白 + 4黑(嘿嘿嘿,一开始我就是这么想的,但是!!!题目中右For that the friends can choose any row of the board and cyclically shift the cells of the chosen row, that is, put the last (rightmost) square on the first place in the row and shift the others one position to the right. You can run the described operation multiple times (or not run it at all).)表示我们可以随意选择行,然后循环移动之,所以第二个条件必定满足,所以我们只需要判断第一个条件是否满足就好~

/*
http://codeforces.com/problemset/problem/259/A
终于读懂了
*/
#include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;
const int maxn = 10;
char s[maxn][maxn];
int main()
{
int n = 8,flag = 1;
for(int i = 0;i < n;++i)
{
scanf("%s",&s[i]);
}
for(int i = 0;i < n && flag;++i)
{
for(int j = 0;j < n - 1 && flag;++j)
{
if(s[i][j] == s[i][j + 1])flag = 0;
}
}
if(flag)printf("YES\n");
else printf("NO\n");
return 0; }

  

最新文章

  1. 《Linux及安全》实践3.3
  2. Azure ARM (4) 开始创建ARM Resource Group并创建存储账户
  3. JS返回上一页
  4. Unity3D ShaderLab 漫反射卷积光照模型
  5. Knockout.Js官网学习(监控属性Observables)
  6. 【Stage3D学习笔记续】山寨Starling(七):一般优化方法简介及混合模式
  7. CPU与外设传送数据方式
  8. java的JCombobox实现中国省市区三级联动
  9. CentOS配置防火墙
  10. BZOJ 3036: 绿豆蛙的归宿( 期望dp )
  11. Windows线程同步(上)
  12. Dom编程(二)
  13. 玩玩微信公众号Java版之二:接收、处理及返回微信消息
  14. 查看linux系统是多少位
  15. mysql 生成时间序列数据 - 存储过程
  16. redis集群(jedis)批量删除同一前缀
  17. 全球晶圆代工厂哪家强?2016年Top30名单
  18. ElasticStack系列之十一 &amp; 同步 mysql 数据的实践与思考
  19. db2 数据库操作JDBC .addBatch() 方法执行时,报错排查结果
  20. meven 配置

热门文章

  1. linux系统web站点设置-http基础设置
  2. Unknown type name &#39;NSString&#39; 解决方案
  3. Delphi、Lazarus保留字、关键字详解
  4. 关于C的int
  5. dirname(__FILE__)
  6. Homestead 修改 Homestead.yaml 文件后 vagrant up 报错的问题
  7. Python之路(第二十四篇) 面向对象初级:多态、封装
  8. Permutations LT46
  9. 在ListView中添加EditText丢失光标问题解决
  10. maven clean package 时出现Failed to read artifact descriptor for的问题解决