简单暴力模拟。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; char s[][]; int main()
{
for(int i=;i<;i++) scanf("%s",s[i]);
int A=0x7FFFFFFF,B=0x7FFFFFFF;
for(int i=;i<;i++)
{
for(int j=;j<;j++)
{
if(s[i][j]=='W')
{
bool fail=;
for(int k=i-;k>=;k--)
if(s[k][j]!='.') fail=;
if(fail==) A=min(A,i);
}
}
} for(int i=;i<;i++)
{
for(int j=;j<;j++)
{
if(s[i][j]=='B')
{
bool fail=;
for(int k=i+;k<;k++)
if(s[k][j]!='.') fail=;
if(fail==) B=min(B,-i);
}
}
}
if(A<=B) printf("A\n");
else printf("B\n");
return ;
}

CodeForces 592A PawnChess的更多相关文章

  1. Codeforces Round #328(Div2)

    CodeForces 592A 题意:在8*8棋盘里,有黑白棋,F1选手(W棋往上-->最后至目标点:第1行)先走,F2选手(B棋往下-->最后至目标点:第8行)其次.棋子数不一定相等,F ...

  2. Codeforces Round #328 (Div. 2) A. PawnChess 暴力

    A. PawnChess Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/592/problem/ ...

  3. Codeforces Round #328 (Div. 2)_A. PawnChess

    A. PawnChess time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  4. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  5. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  6. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  7. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  8. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  9. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

随机推荐

  1. phpstorm中快速添加函数注释

    Preferences 或 command+,快捷键 Live Templates - PHP 下方 - 新建模板 ,Abbreviation 命名随便写,点击Edit Variables配置变量信息 ...

  2. ios---setContentOffset

    UIView * farmeView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,  self. ...

  3. vs2010 在函数级别设置优化

    平时开发的时候,为了方便调试,visual studio 的Configuration 设置成Release. 同时为了事后调试,Optimization总是设置成Disabled.这样做是方便查看变 ...

  4. macos openssl 生成rsa证书 -mark

    创建私钥 openssl genrsa -out rsa_private_key.pem 1024 创建无密码私钥 openssl pkcs8 -topk8 -inform PEM –nocrypt ...

  5. System类与两种输入流

    1.System类对I/O的支持系统输出System.out.println 是利用了I/O流的模式完成的.实际是打印流PrintStream对象 System类中定义了三个操作的常量 1.标准/系统 ...

  6. Redux 和 mobx的区别

    Redux: Redux将数据保存在单一store中,Mobx将数据保存在分散的多个store中 Redux需要手动处理变化后的操作,Mobx使用observable保存数据,数据变化后自动处理响应的 ...

  7. 主成分分析、因子分析、ICA(未完成)

    并且SVD分解也适用于一般的矩阵. 主成分分析可以简单的总结成一句话:数据的压缩和解释.常被用来寻找判断某种事物或现象的综合指标,并且给综合指标所包含的信息以适当的解释.在实际的应用过程中,主成分分析 ...

  8. 路由器wan口ip地址显示0.0.0.0怎么办

    http://m.xuexila.com/luyouqi/671049.html 这个网络时代里面我们最常用来连接网络的设备就是路由器了,现在的社会不管是工作还是生活几乎都离不开网络了,同时我们也要学 ...

  9. Sql Server 中锁的概念(2)

    1.一般大家都对事务的四种隔离模式比较熟悉,从松到严依次是: - 读取未提交(Read uncommitted):处于此模式下可能会出现脏读.幻象读.不可重复读 - 读取已提交(Read commit ...

  10. 深入理解typeof操作符

    typeof可以检测数据的类型 typeof返回结果的其实是字符串:可以通过以下测试出来 console.log( typeof(typeof(a))); // string typeof返回的数据类 ...