快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 2806 | Accepted: 1865 |
Description
Input
Output
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的更多相关文章
- 模拟 POJ 2993 Emag eht htiw Em Pleh
题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...
- 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 ...
- 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 ...
- poj 2993 Emag eht htiw Em Pleh(模拟)
题目:http://poj.org/problem?id=2993 题意:和2996反着 #include <iostream> #include<cstdio> #inclu ...
- POJ 2993:Emag eht htiw Em Pleh
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64 ...
- 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: ...
- 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 ...
- Emag eht htiw Em Pleh(imitate)
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2901 Accepted: ...
- 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 ...
随机推荐
- Silverlight中ListBox的数据绑定
在Silverlight中ListBox是一个非常强大的控件.总结下ListBox的绑定数据的方式. 首先,新建一个Book类, public class Book { public string B ...
- github push error ---- recursion detected in die handler
错误提示如下: 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 New Bitmap Image.bmp Coun ...
- 江苏新美星智能物流无人叉车AGV
新美星一家全球领先的液体包装解决方案供应商,高附加值的产品应用于食品饮料等行业,为液体食品和自动化系统提供完整解决方案.新美星,于CBST2017展会首次亮相了能够从仓库或工厂的某个地方把材料.托盘和 ...
- sublime text2和3怎么设置修改字体
首先,请打开你的sublime text2或3,点击工具栏中的Preferences 然后打开Settings-User 打开Settings-User之后 如下图 请复制以下代码然后粘贴至花括号内 ...
- 使用递归打印二叉树的左视图 java
使用递归打印二叉树的左视图 java package com.li.jinRiTouTiao; public class PrintLeftView { static class TreeNode{ ...
- 关于Oracle误操作--数据被Commit后的数据回退恢复(闪回)
今天操作Oracle数据库时,做一个Update数据时,不小心少写了个where,看这粗心大意的. 于是乎,把所有的员工工号都给更新成一个同一个工号了.这是一个悲催的故事. 因为工号是Check了好多 ...
- 028-touch命令
1.创建空文件.可以创建一个空文件,也可以批量创建空文件. 2.更改文件/目录的访问时间,如果文件存在就更改访问时间,不存在就创建.# touch -a 3.更改文件的访问时间和修改时间.如果文件存在 ...
- Python笔记 #16# Pandas: Operations
10 Minutes to pandas #Stats # shift 这玩意儿有啥用??? s = pd.Series([1,5,np.nan], index=dates).shift(0) # s ...
- Java实现文件上传到服务器(FTP方式)
Java实现文件上传到服务器(FTP方式) 1,jar包:commons-net-3.3.jar 2,实现代码: //FTP传输到数据库服务器 private boolean uploadServer ...
- linux第五周
第五周 给MenuOS增加time和time-asm命令 更新menu代码到最新版 在main函数中增加MenuConfig 增加对应的Time函数和TimeAsm函数 make rootfs 使用g ...