简单暴力模拟。

#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. java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()

    原因:hibernate-jpa-2.0-api-1.0.0.Final.jar.ejb3-persistence.jar中的javax.persistence与javaEE 5 Librares中的 ...

  2. 程序员面试系列之Java单例模式的攻击与防御

    我写的程序员面试系列 Java面试系列-webapp文件夹和WebContent文件夹的区别? 程序员面试系列:Spring MVC能响应HTTP请求的原因? Java程序员面试系列-什么是Java ...

  3. Node.js fs文件系统模块

    一.读取文件几个步骤 1.先引入fs文件系统模块 2.使用readfile 或 readFileSync 注意点:它们的回调函数有两个参数,第一个是err,第二个是data,得到的data是buffe ...

  4. canvas之刮刮乐

    效果图: 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  5. Yii1 获取当前请求的url

    echo Yii::app()->getRequest()->getUrl();

  6. HDU-5253-链接的管道

    http://acm.hdu.edu.cn/showproblem.php?pid=5253 #include <iostream> #include <bits/stdc++.h& ...

  7. SpringBoot的线程调度

    Spring Boot默认提供了一个ThreadPoolTaskExecutor作为线程调度器,只需要在配置类中使用注解EnableAsync即可开启异步线程调度.在实际要执行的Bean中使用@Asy ...

  8. (16) Cloudflare pki公钥基础设施

    该工具组共有8个工具 1.cfssl 常用的可用指令: sign signs a certificate bundle build a certificate bundle genkey genera ...

  9. Go:单元测试

    测试用的文件名必须以 _test.go 结尾: 测试用的函数名必须以 Test 开头,一般来说:Test+被测试的函数名(第一个字母必须大写): func TestXx(t *testing.T) { ...

  10. Linux查看配置文件中未被注释的有效配置行

    grep 命令示例——去掉注释 $ grep -v "^#" /path/to/config/file $ grep -v "^#" /etc/apache2/ ...