【暴搜比DFS稍微好想一点】CODEFORCE 7A— Kalevitch and Chess
来源:互联网 发布:卡乐购卡盟源码 编辑:程序博客网 时间:2024/06/08 16:30
来源:点击打开链接
大意是有一个8x8的图形,刚开始上面的每一个格子都是白色,现在给定一个状态,问最少需要几步才能由初始化状态到当前状态。
可以DFS,第一印象也是DFS,但是简单的使用模拟,可能会大大的提高效率。
统计行,行占满了看列。
#include<iostream>using namespace std;char map[8][8];int main(){ int i,j; int column=0,row=0; int tar=0; int mapview=8; for(int i=0;i<=7;i++) for(int j=0;j<=7;j++) cin>>map[i][j]; for(int i=0;i<=7;i++) { tar=0;for(j=0;j<=7;j++) { if(map[i][j]=='B') tar++; } if(tar==mapview) { column=column+1; } elserow=tar; } int total=column+row; cout<<total<<endl; return 0;}
- 【暴搜比DFS稍微好想一点】CODEFORCE 7A— Kalevitch and Chess
- codeforce 7A. Kalevitch and Chess(粉刷)
- 7A Kalevitch and Chess
- A. Kalevitch and Chess
- CF 7A——比赛A Kalevitch and Chess
- codeforces 7A - Kalevitch and Chess
- code forces 7A Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- 【取巧遍历】#7 A. Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CF 7A Kalevitch and Chess
- codeforces 7 A. Kalevitch and Chess
- CodeForces 7A - Kalevitch and Chess
- cf 7a Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- Linux 学习笔记(三)超级用户
- (转) java -jar参数运行打包好的jar应用程序的时候发现应用程序无法找到classpath下设置好的第三方类库?
- WWDC2012:Objective-C的新特性
- C语言运算符优先级和口诀
- 悲催的炒股经历
- 【暴搜比DFS稍微好想一点】CODEFORCE 7A— Kalevitch and Chess
- C++代码功能块备忘
- Linux crontab 命令格式与详细例子
- 两种方式实现SQLite 主键自动增加
- 临时
- 最重要的 10 几个 J2EE 最佳实践
- Ubuntu 迅雷安装包DEB 32位和64位
- 解决org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hibernat
- android在activity中锁屏解锁后重走OnCreate的问题的解决办法