快速切题 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 ...
随机推荐
- 爬虫Scrapy框架
安装scrapy 在安装过程中报错:解决方案 通过在https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted,然后下载: CP后是python 版本,32 ...
- MapReduce中的Shuffle和Sort分析
MapReduce 是现今一个非常流行的分布式计算框架,它被设计用于并行计算海量数据.第一个提出该技术框架的是Google 公司,而Google 的灵感则来自于函数式编程语言,如LISP,Scheme ...
- [css]浮动造成的影响
浮动造成的影响: 子元素浮动,父元素无法被撑出高了. 如果要给父元素做通栏background? 如果两个box的子元素都浮动,且希望两个box分行显示? box1 box2 box3: float: ...
- 最佳虚拟容器LXC
最佳虚拟容器LXC 和"真正的虚拟机环境"不同, "容器"(container)只能在Linux上虚拟Linux, 不能虚拟WIndows, 因为它不能虚拟硬件 ...
- Vue-cli proxyTable 解决开发环境的跨域问题
Vue-cli proxyTable 解决开发环境的跨域问题 proxyTable: { '/list': { target: 'http://api.xxxxxxxx.com', pathRewri ...
- AVAudioFoundation(1):使用 AVAsset
本文转自:AVAudioFoundation(1):使用 AVAsset | www.samirchen.com 本文主要内容来自 AVFoundation Programming Guide. 要了 ...
- 【运维技术】shell脚本实现线程挂掉,自动重启功能
由于分布式系统的流行,服务器上面部署的项目都是多实例的.而我又希望有一个功能,当服务器出现异常情况能够自动重启实例. 所以我想到了使用shell脚本监控实例进程id,如果不存在的话,就重启对应的实例. ...
- 【转载】Java动态代理之JDK实现和CGlib实现(简单易懂)
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6542259.html 一:代理模式(静态代理) 代理模式是常用设计模式的一种,我们在软件设计时常用的代理一般是 ...
- php 发送邮件类
//******************** 配置信息 ******************************** $smtpserver = "smtp.263 ...
- ubuntu16.04深度学习环境的配置【转】
本文转载自:https://my.oschina.net/u/3837179/blog/1920756 在ubuntu中配置GPU的深度学习环境相较于win问题要多很多,这几天琢磨了一下Ubuntu下 ...