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. jquery 数组求差集,并集

    var alpha = [1, 2, 3, 4, 5, 6], beta = [4, 5, 6, 7, 8, 9]; $.arrayIntersect = function(a, b){ return ...

  2. android EditText长按屏蔽ActionMode context菜单但保留选择工具功能

    最近项目要求屏蔽EditText 长按出来的ActionMode菜单,但是要保留选择文本功能.这个屏蔽百度会出现各种方法,这里说一下我的思路: 1.屏蔽百度可知setCustomSelectionAc ...

  3. MVC权限管理系统dwpro项目权限按钮无故自动消失问题

    关于那个权限按钮丢失的问题修改方法如下: 把源文件中的XmlConfig文件夹里的Config.xml文件剪切到根目录下,并修改文件名为:app.config(关键是后缀不是xml了是config) ...

  4. String[] 转List<String>

    String[] 转List<String> String[] idArr = ids.split(","); List<String> idList = ...

  5. oracle查询表的索引

    select * from user_indexes where table_name='表名'; select * from user_ind_columns where index_name='索 ...

  6. LDA-math-认识Beta/Dirichlet分布

    http://cos.name/2013/01/lda-math-beta-dirichlet/#more-6953 2. 认识Beta/Dirichlet分布2.1 魔鬼的游戏—认识Beta 分布 ...

  7. SQLServer出现 '其他会话正在使用事务的上下文' 的问题原因,什么是环回链接服务器?(转载)

    本人经过百度查找并且自己进行测试得到问题原因: MSDN上看了一下说是sql server 不支持在分布式事务处理中存在指向本地的链接服务器(环回链接服务器) 通过上面简单说明大家有可能没完全理解环回 ...

  8. OpenStack 镜像制作

    Contents [hide] 1 Centos6.5 img制作 1.1 基础环境安装 1.2 下载或从本地上传系统镜像 1.3 启动服务 1.4 建立镜像文件 1.5 通过virt-install ...

  9. 【secureCRT】中文乱码问题

    Options->Session Options->Appearance->Font->新宋体 字符集:中文GB2312 ->Character encoding 为UT ...

  10. 空格和TAB键混用错误:IndentationError: unindent does not match any outer indentation level

    转自:http://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/ [已解决]Python脚本运行出现语法错误: ...