poj 2993 Emag eht htiw Em Pleh(模拟)
题目:http://poj.org/problem?id=2993
题意:和2996反着
#include <iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std; struct node
{
int x,y;
char ch;
}q[];
bool cmp(node a,node b)
{
if(a.x!=b.x) return a.x>b.x;
return a.y<b.y;
} int main()
{
int sum=,i,j,t=;
char c,a,b,d; scanf("White:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='P'; q[sum].x=b-; q[sum++].y=a-;
}
}
scanf("Black:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a+; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='p'; q[sum].x=b-; q[sum++].y=a-;
}
}
sort(q,q+sum,cmp);
for(i=; i>=; i--)
{
printf("+---+---+---+---+---+---+---+---+\n");
for(j=; j<; j++)
{
if((i+j)%==) a='.';
else a=':';
if(q[t].x==i&&q[t].y==j&&t<sum)
{printf("|%c%c%c",a,q[t].ch,a); t++;}
else
printf("|%c%c%c",a,a,a);
}
cout<<"|"<<endl;
}
printf("+---+---+---+---+---+---+---+---+\n");
return ;
}
poj 2993 Emag eht htiw Em Pleh(模拟)的更多相关文章
- 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2806 Accepted: ...
- 模拟 POJ 2993 Emag eht htiw Em Pleh
题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...
- POJ 2993 Emag eht htiw Em Pleh【模拟画棋盘】
链接: http://poj.org/problem?id=2993 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27454#probl ...
- Poj 2993 Emag eht htiw Em Pleh
1.Link: http://poj.org/problem?id=2993 2.Content: Emag eht htiw Em Pleh Time Limit: 1000MS Memory ...
- POJ 2993:Emag eht htiw Em Pleh
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64 ...
- Emag eht htiw Em Pleh 分类: POJ 2015-06-29 18:54 10人阅读 评论(0) 收藏
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2937 Accepted: ...
- 模拟 + 打表 --- Emag eht htiw Em Pleh
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2578 Accepted: ...
- Emag eht htiw Em Pleh
Emag eht htiw Em Pleh This problem is a reverse case of the problem 2996. You are given the output o ...
- Emag eht htiw Em Pleh(imitate)
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2901 Accepted: ...
随机推荐
- 链接中 href='#' 和 href='###' 的区别以及优缺点
首先,<a> 标签 + onclick='{jscode}' 是很常用的一种 js 运用方式,而不使用 href='javascript:{jscode}' 是为了兼容多种浏览器对 < ...
- centos6.4下安装freetds使php支持mssql
centos版本:6.4 php版本5.3.17 没有安装之前的情况:nginx+php+mysql+FPM-FCGI 接下来安装步骤如下: 1.打开http://www.freetds.org/,进 ...
- NFS网络文件共享服务
NFS-网络文件系统,它的主要功能是通过网络让不同的主机系统之间可以彼此共享文件或目录. NFS在企业中得应用场景 在企业集群架构的工作场景中,NFS网络文件系统一般被用来存储共享视频.图片.附件等静 ...
- [旧博客]Python 第一天总结
语法部分: 3**4 表示3的四次方 -1**3 结果是-1 raw_input 输入文本 input 输入值,input 3*3 结果为9 pow(5,5) 等于 5*5 abs(-1.8) 等于 ...
- 64位Python安装PIL
写个小程序需要安装PIL,但是官网只有32位,无法找到64位安装路径.根据网上教程自行编译,但是由于VS版本问题总是提示“Python error: Unable to find vcvarsall. ...
- iomanip,setw(),setw: undeclared identifier
今天使用setw(),提示setw: undeclared identifier,上网查了下,原来是没有包含头文件iomanip,现摘录如下: iomanip #include <iomanip ...
- Keil V4.72升级到V5.1X之后
问题描述 Keil V4.72升级到V5.1x之后,原来编译通过的工程,出现了如下错误: .\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\STM32f ...
- 【BZOJ1251】序列终结者
Description 网上有许多题,就是给定一个序列,要你支持几种操作:A.B.C.D.一看另一道题,又是一个序列 要支持几种操作:D.C.B.A.尤其是我们这里的某人,出模拟试题,居然还出了一道这 ...
- EvnetBus
领域事件(EvnetBus) 文档目录 本节内容: EventBus 注入 IEventBus 获取默认实例 定义事件 预定义事件 处理完异常 实体修改 触发事件 处理事件 处理基类事件 处理程序 ...
- centos7安装chrome及加载poatman开发插件
为什么要安装chrome?因为centos7的默认浏览器firefox的实在是不习惯,上面占了太多,本来显示器就不大... 好了,首先下载chome的rpm安装包(如果需要的可以留言,我有备份) 然后 ...