Emag eht htiw Em Pleh 分类: POJ 2015-06-29 18:54 10人阅读 评论(0) 收藏
2015-06-29 18:54
465 查看
Emag eht htiw Em Pleh
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
Sample Output
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 2937 | Accepted: 1944 |
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; }
相关文章推荐
- django 1.7 新的migration框架,取代south
- Python数值计算工具包numpy,scipy,theano等的安装--Anaconda
- c++ primer读书笔记-第四章 数组和指针
- Exchange Server 2010续定证书系列1-从服务器生成续定请求文件
- Git常用操作
- cocos2d-x 改变sprite图片
- [leetcode] Length of Last Word
- POJ 1990 MooFest【 树状数组 】
- 关于一个int *ptr=(int *)(&a+1)问题的探讨
- 神经网络-向后传播java实现
- HTML 标签语义
- mysql 所使用的表类型不支持fulltext
- 谈谈一个重要的http协议头标:X-Forwarded-For
- mysql主从配置
- repo—git入门使用
- android 自定义折线图
- UITextView 文字上留有一大片空白
- MyEclipse 快捷键大全
- LeetCode_Convert Sorted Array to Binary Search Tree
- 极致简单的二维码条形码扫描工具