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. mysql:键缓存

    myisam的主要优化参数: key_buffer_size - 这对MyISAM表来说非常重要,是用来设置整个MySQL中常规Key Cache的大小.一般来说,如果MySQL运行在32位平台,此值 ...

  2. PAT 解题报告 1048. Find Coins (25)

    1048. Find Coins (25) Eva loves to collect coins from all over the universe, including some other pl ...

  3. c++l类

    c++类和C#中定义类的方法异同之处: 1. 相同处: 1.1.都需要使用 class标识: 1.2.都包含有成员:函数,属性: 1.3.都有private public protect 标识的成员 ...

  4. c语言的一些库

    1利用DEv编程的时候遇见sleep函数  ..注意S大写,并添加#include<windows.h>.

  5. html 标签内部元素上下居中

    <div style="width: 200px; height: 200px; border: 1px solid red; line-height: 200px;"> ...

  6. [转] 国内外最全面和主流的JS框架与WEB UI库(强烈推荐)

    国内外最全面和主流的JS框架与WEB UI库...   当下对于网站前段开发人员来说,很少有人不使用一些JS框架或者WEB UI库,因此这些可以有效提高网站前段开发速度,并且能够统一开发环境,对于不同 ...

  7. oracle的表空间

    创建表空间 1:创建单个文件的表空间 CREATE TABLESPACE SAMPLE LOGGING DATAFILE 'D:\11.dbf' SIZE 5M REUSE EXTENT MANAGE ...

  8. 如何通过类找到对应的jar包

    ctrl+shift+T 然后输入对应类  

  9. 【SPFA】 最短路计数

    最短路计数 [问题描述]   给出一个N个顶点M条边的无向无权图,顶点编号为1-N.问从顶点1开始,到其他每个点的最短路有几条. [输入格式]   输入第一行包含2个正整数N,M,为图的顶点数与边数. ...

  10. 想学习一下CSS函数

    好像原来都是用前后端代码实现的功能,如今CSS3已经吸纳为标准,使用简单的选择器就可以实现了.