CodeForces 7A Kalevitch and Chess
来源:互联网 发布:自学凸优化 编辑:程序博客网 时间:2024/05/16 17:42
dfs都不需要,由于题目只给8*8的范围,所以直接暴力就好了。。。
#include "string"#include "iostream"#include "cstdio"#include "cmath"#include "set"#include "queue"#include "vector"#include "cctype"#include "sstream"#include "cstdlib"#include "cstring"#include "stack"#include "ctime"#include "algorithm"#define pa pair<int,int>#define Pi M_PI#define INF 0x3f3f3f3f#define INFL 0x3f3f3f3f3f3f3f3fLLusing namespace std;typedef long long LL;const int M=55;char mp[10][10]; int main(){ int i,j; for(i=1;i<=8;++i) for(j=1;j<=8;++j) cin>>mp[i][j]; int s,t,cnt; s=0,t=0,cnt=0; for(i=1;i<=8;++i) { t=0; for(j=1;j<=8;++j) { if(mp[i][j]=='B') t++; } if(t==8) cnt++; else s=t; } cout<<s+cnt<<endl; return 0; }
0 0
- codeforces 7A - Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- codeforces 7 A. Kalevitch and Chess
- CodeForces 7A - Kalevitch and Chess
- CodeForces 7A Kalevitch and Chess
- Codeforces 7A Kalevitch and Chess
- 7A Kalevitch and Chess
- Codeforces Beta Round #7 A. Kalevitch and Chess
- CodeForces - 7A Kalevitch and Chess(搜索?!模拟!)
- A. Kalevitch and Chess
- code forces 7A Kalevitch and Chess
- 【取巧遍历】#7 A. Kalevitch and Chess
- CF 7A Kalevitch and Chess
- cf 7a Kalevitch and Chess
- A. Kalevitch and Chess【思维】
- poj 1330
- CodeForces 7C Line (扩展欧几里得)
- Learn Python The Hard Way学习(16) - 读写文件
- js模拟多线程
- Zend Framework1-Zend_Db_Adapter
- CodeForces 7A Kalevitch and Chess
- Windows下字符编码转换(ANSI <--> Unicode <--> UTF-8)
- UITextView 或 继承自UIScrollView的控件在UINavigationController的根控制下的奇怪现象
- [数学模型]整数规划(一)
- CAS SSO 简介
- 心灵徒步-再回北京奋斗的路途
- 基本css样式
- IE上图片显示不出来
- 4*4魔方设计(作业)