Emag eht htiw Em Pleh
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 2937   Accepted: 1944

Description

This problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find the corresponding input.

Input

according to output of problem 2996.

Output

according to input of problem 2996.

Sample Input

White: Ke1,Qd1,Ra1,Rh1,Bc1,Bf1,Nb1,a2,c2,d2,f2,g2,h2,a3,e4
Black: Ke8,Qd8,Ra8,Rh8,Bc8,Ng8,Nc6,a7,b7,c7,d7,e7,f7,h7,h6

Sample Output

+---+---+---+---+---+---+---+---+
|.r.|:::|.b.|:q:|.k.|:::|.n.|:r:|
+---+---+---+---+---+---+---+---+
|:p:|.p.|:p:|.p.|:p:|.p.|:::|.p.|
+---+---+---+---+---+---+---+---+
|...|:::|.n.|:::|...|:::|...|:p:|
+---+---+---+---+---+---+---+---+
|:::|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|...|:::|...|:::|.P.|:::|...|:::|
+---+---+---+---+---+---+---+---+
|:P:|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|.P.|:::|.P.|:P:|...|:P:|.P.|:P:|
+---+---+---+---+---+---+---+---+
|:R:|.N.|:B:|.Q.|:K:|.B.|:::|.R.|
+---+---+---+---+---+---+---+---+
还是模拟题
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std; const int Max=1100000; char str[]="+---+---+---+---+---+---+---+---+";
char s1[]="|:::|...|:::|...|:::|...|:::|...|";
char s2[]="|...|:::|...|:::|...|:::|...|:::|";
char Map[55][55];
void Trans(char s[])
{
bool flag=false;
if(s[0]=='B')
{
flag=true;
}
for(int i=7; s[i];)
{
if(s[i]>='A'&&s[i]<='Z')
{
int u=s[i+1]-'a'+1;
int v=s[i+2]-'0';
if(flag)
{
Map[v][u]=s[i]+32;
}
else
{
Map[v][u]=s[i];
}
i+=4;
}
else if(s[i]>='a'&&s[i]<='z')
{
int u=s[i]-'a'+1;
int v=s[i+1]-'0';
if(flag)
{
Map[v][u]='p';
}
else
{
Map[v][u]='P';
}
i+=3;
}
}
}
int main()
{
char white[110];
char black[110];
memset(white,'\0',sizeof(white));
memset(black,'\0',sizeof(black));
gets(white);
gets(black);
memset(Map,0,sizeof(Map));
Trans(white);
Trans(black);
int u=8;
for(int i=17; i>=1; i--)
{
if(i%2)
{
printf("%s\n",str);
}
else
{
int ans=2;
int v=1;
if((i/2)%2)
{
for(int j=0; j<33; j++)
{
if(j!=ans)
{
printf("%c",s1[j]);
}
else
{
if(Map[u][v])
{
printf("%c",Map[u][v]);
}
else
{
printf("%c",s1[j]);
}
v++;
ans+=4;
}
}
}
else
{
for(int j=0; j<33; j++)
{
if(j!=ans)
{
printf("%c",s2[j]);
}
else
{
if(Map[u][v])
{
printf("%c",Map[u][v]);
}
else
{
printf("%c",s2[j]);
}
v++;
ans+=4;
}
}
}
printf("\n");
u--;
}
}
return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

Emag eht htiw Em Pleh 分类: POJ 2015-06-29 18:54 10人阅读 评论(0) 收藏的更多相关文章

  1. Tautology 分类: POJ 2015-06-28 18:40 10人阅读 评论(0) 收藏

    Tautology Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10428   Accepted: 3959 Descri ...

  2. Number Sequence 分类: HDU 2015-06-19 20:54 10人阅读 评论(0) 收藏

    Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...

  3. Ubuntu vim+ ctags(包含系统函数) + taglist 配置 分类: vim ubuntu 2015-06-09 18:19 195人阅读 评论(0) 收藏

    阅读大型代码,我们经常需要打开很多的代码文件,搜索各种定义.windows下用惯了ide的朋友,转战Linux的时候可能会觉得很难受,找不到合适的阅读工具.其实万能的vim就可以实现.下面介绍一下vi ...

  4. OpenCV与QT联合编译 分类: Eye_Detection ZedBoard OpenCV shell ubuntu 2014-11-08 18:54 143人阅读 评论(0) 收藏

    问题1:首先参考rainysky的博客,发现qmake时发生找不到目录,文件的错误,又找不到 qmake.conf 文件的写法.所以开始按照网上的程序修改 XXX.pro 文件. 问题2:使用QT C ...

  5. Rebuild my Ubuntu 分类: ubuntu shell 2014-11-08 18:23 193人阅读 评论(0) 收藏

    全盘格式化,重装了Ubuntu和Windows,记录一下重新配置Ubuntu过程. //build-essential sudo apt-get install build-essential sud ...

  6. 由 argv引出的main参数 分类: C/C++ 2014-11-08 18:00 154人阅读 评论(0) 收藏

    我们经常用的main函数都是不带参数的.因此main 后的括号都是空括号.实际上,main函数可以带参数,这个参数可以认为是 main函数的形式参数.C语言规定main函数的参数只能有两个, 习惯上这 ...

  7. Monthly Expense(二分) 分类: 二分查找 2015-06-06 00:31 10人阅读 评论(0) 收藏

    Description Farmer John is an astounding accounting wizard and has realized he might run out of mone ...

  8. [leetcode] Reverse Linked List 分类: leetcode 算法 2015-07-09 18:44 2人阅读 评论(0) 收藏

    反转链表:比较简单的问题,可以遍历也可以递归. # Definition for singly-linked list. class ListNode: def __init__(self, x): ...

  9. Win10尝鲜体验——初识传说中不一样的Windows 分类: 资源分享 2015-07-24 18:27 13人阅读 评论(0) 收藏

    这几天,网上传来一个消息,虽然不知是好是坏,Win10可以下载安装了! 出于好奇,下载尝鲜,几个截图,留作纪念~ 中文,还是要好好支持的,毕竟中国有如此多的用户 可选的安装版本 许可条款也刚刚出炉,估 ...

随机推荐

  1. linux:问题

    1>.Xshell远程连接linux闲置时间过长会自动中断连接: 2>.在linux环境下乱码: 3>.在linux下面执行mv /bin/ls /root/bin之后执行ls就不能 ...

  2. 支持正则或通配符的hashmap

    RegexpKeyedMap http://wiki.apache.org/jakarta/RegexpKeyedMap RegexHashMap https://heideltime.googlec ...

  3. Swift游戏实战-跑酷熊猫 04 熊猫的跳和滚的动作

    这节内容,我们利用上一节学过的内容,给熊猫添加跳和滚动的动作.同时通过重载touchBegan方法来响应动作.切换跑,跳,滚. 要点: 通过序列帧纹理产生动画: SKAction.animatWith ...

  4. Redis Sets

    Sets Sets 就是一个集合,集合的概念就是一堆不重复值的组合.利用Redis提供的Sets数据结构,可以存储一些集合性的数据,比如在微博应用中,可以将一个用户所有的关注人存在一个集合中,将其所有 ...

  5. Python基础(1)python+Eclipse+pydev环境搭建

    编辑器:Python 自带的 IDLE 简单快捷, 学习Python或者编写小型软件的时候.非常有用.         编辑器: Eclipse + pydev插件 1. Eclipse是写JAVA的 ...

  6. 查看真机的系统中sdk的版本

    1.adb devices 确保连接上了真机 2.adb shell 进入android系统 3.进入system目录下 4.查看build.prop文件 cat build.prop

  7. WEB-INF/views/menu/list.jsp (line: 26, column: 58) equal symbol expected

    根本原因是由于单引号和双引号的混乱使用导致的. 解决办法: 将双引号里面的双引号改成单引号: 单引号里面的双引号该成单引号. 我的问题好像又不是这样的,<c:forEach var=" ...

  8. 10---Net基础加强

    复习: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Syst ...

  9. mongodb版本管理

    使用gradle. 查找最新版本http://mvnrepository.org/ compile "org.mongeez:mongeez:0.9.6" 配置spring < ...

  10. cvLoadImage函数解析 cvLoadImageM()函数

    1.函数原型:IplImage* cvLoadImage( const char* filename, int flags=CV_LOAD_IMAGE_COLOR ); filename :要被读入的 ...