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

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<cstdio>
#include <cstring>
using namespace std;
char maz[17][34];
int mp[255];
char cell[2][3][6]={
{
"+---+",
"|:::|",
"+---+",
},
{
"+---+",
"|...|",
"+---+",
}
};
void dye(int x,int y){
for(int i=0;i<3;i++){
for(int j=0;j<5;j++){
maz[2*x+i][4*y+j]=cell[(x+y)&1][i][j];
}
}
}
void clearchess(){
memset(maz,0,sizeof(maz));
for(int i=0;i<8;i++){
for(int j=0;j<8;j++){
dye(i,j);
}
}
}
char buff[1024];
void subinsrt(int x,int y,char ch){
x--;
maz[2*x+1][4*y+2]=ch;
}
void insrt(bool upc){
int len=strlen(buff);
char use;
for(int i=0;i<len;){
int j;
for( j=i;j<len&&buff[j]!=',';j++){}
if(j-i==3)use=buff[i];
else use='P';
if(upc)subinsrt(buff[j-1]-'0',mp[buff[j-2]],use);
else subinsrt(buff[j-1]-'0',mp[buff[j-2]],use-'A'+'a');
i=j+1;
// for(int i=0;i<17;i++)puts(maz[i]);
}
}
int main(){
for(int i=0;i<26;i++)mp[i+'a']=i;
clearchess();
scanf("%s",buff);
scanf("%s",buff);
insrt(true);
scanf("%s",buff);
scanf("%s",buff);
insrt(false);
for(int i=16;i>=0;i--)puts(maz[i]);
return 0;
}

  

快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0的更多相关文章

  1. 模拟 POJ 2993 Emag eht htiw Em Pleh

    题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...

  2. 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 ...

  3. 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 ...

  4. poj 2993 Emag eht htiw Em Pleh(模拟)

    题目:http://poj.org/problem?id=2993 题意:和2996反着 #include <iostream> #include<cstdio> #inclu ...

  5. POJ 2993:Emag eht htiw Em Pleh

    Emag eht htiw Em Pleh Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64 ...

  6. 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: ...

  7. 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 ...

  8. Emag eht htiw Em Pleh(imitate)

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

  9. POJ2993——Emag eht htiw Em Pleh(字符串处理+排序)

    Emag eht htiw Em Pleh DescriptionThis problem is a reverse case of the problem 2996. You are given t ...

随机推荐

  1. Python的Flask框架应用调用Redis队列数据的方法

    转自:http://www.jb51.net/article/86021.htm 任务异步化 打开浏览器,输入地址,按下回车,打开了页面.于是一个HTTP请求(request)就由客户端发送到服务器, ...

  2. UML Diagrams Using Graphviz Dot

    Introduction Background This article is about using the dot tool from the Graphviz package to automa ...

  3. Virtualbox中win7虚拟机中U盘不可用问题的解决

    Virtualbox版本是5.0.0,主机运行多是Ubuntu12.04 LTS,虚拟机是Win7 X64.起初Win7正常运行,Virtualbox的增强功能已安装.下面是如何一步一步解决U盘不可用 ...

  4. java多线程(五)

    Java 多线程同步 锁机制与synchronized 打个比方:一个object就像一个大房子,大门永远打开.房子里有很多房间(也就是方法).这些房间有上锁的(synchronized方法), 和不 ...

  5. 4.9 Routing -- Query Parameters

    一.概述 1. 在URL中查询参数是可选的key-value对,出现在?的右边.例如,下面的URL有两个查询参数,sort和page,对应的值分别是ASC和2. example:http://exam ...

  6. 在GUI程序中使用控制台的两种方法

    win32程序启用控制台(控制台文件名:conout$,conin$,conerr$) //添加控制台,加入在程序构造函数中 AllocConsole(); freopen("conin$& ...

  7. WordPress配置

    1.准备工作: 下载comsenzexp.exe 下载wordpress.zip 2.安装comsenzexp.exe,安装有个wwwroot目录: 3.解压wordpress.zip,然后ctrl+ ...

  8. (24)如何使用HttpClient

    介绍 HttpClient是HTTP客户端的接口.HttpClient封装了各种对象,处理cookies,身份认证,连接管理等. 概念 HttpClient的使用一般包含下面6个步骤: 创建 Http ...

  9. swoole gets

    控制器调用: function gets() { $model = Model('ap_pic'); $model->select = ' id, size_type '; $gets['pag ...

  10. 78. Subsets(回溯)

      Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The sol ...