快速切题 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 ...
随机推荐
- centos7 安装Mariadb
MariaDB 数据库管理系统是 MySQL 的一个分支,主要由开源社区在维护,采用 GPL 授权许可.开发这个分支的原因之一是:甲骨文公司收购了 MySQL 后,有将 MySQL 闭源的潜在风险,因 ...
- centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 访问控制 apache rewrite 配置开机启动apache tcpdump 第二十节课
centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 ...
- Windows版本搭建安装React Native环境配置
1 安装Chocolatey 打开cmd黑窗口 @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-obje ...
- sql用法
1: SELECT `SCHEMA_NAME` FROM `information_schema`.`SCHEMATA`; 查询sql中的数据库名 2: select * from for ...
- jQuery事件-div的显示隐藏及鼠标的移入移出
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- 数据挖掘-逻辑Logistic回归
逻辑回归的基本过程:a建立回归或者分类模型--->b 建立代价函数 ---> c 优化方法迭代求出最优的模型参数 --->d 验证求解模型的好坏. 1.逻辑回归模型: 逻辑回归(L ...
- JDBC连接数据库(二)
原文地址https://blog.csdn.net/jq_ak47/article/details/55049639 Mysql for java 的JDBC 驱动库安装 1.将下载下来的5.1.40 ...
- hdu5141 线段树
这题说的是给了一串然后计算出这个串的最长递增子序列的长度,然后计算出有过少个子串[i,j] 他们的最长递增子序列和这整个子串的最长递增子序列相同,我们对于每个j最长递增子序列找出他在序列中的使成为最长 ...
- js动态创建Form表单并提交
javascript动态创建Form表单和表单项,然后提交表单请求,最后删除表单,代码片段如下(Firefox测试通过): var dlform = document.createElement('f ...
- PostgreSQL 9.3:在windows(包括win7)下的安装与正确配置
首先,以下是常用命令: ③ initdb 初始化 数据库. ④ pg_ctl start 启动数据库 ⑤ pg_ctl stop 停止数据库 ⑥ post_svc -install 建立windows ...