题目:http://poj.org/problem?id=2993

题意:和2996反着

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std; struct node
{
int x,y;
char ch;
}q[];
bool cmp(node a,node b)
{
if(a.x!=b.x) return a.x>b.x;
return a.y<b.y;
} int main()
{
int sum=,i,j,t=;
char c,a,b,d; scanf("White:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='P'; q[sum].x=b-; q[sum++].y=a-;
}
}
scanf("Black:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a+; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='p'; q[sum].x=b-; q[sum++].y=a-;
}
}
sort(q,q+sum,cmp);
for(i=; i>=; i--)
{
printf("+---+---+---+---+---+---+---+---+\n");
for(j=; j<; j++)
{
if((i+j)%==) a='.';
else a=':';
if(q[t].x==i&&q[t].y==j&&t<sum)
{printf("|%c%c%c",a,q[t].ch,a); t++;}
else
printf("|%c%c%c",a,a,a);
}
cout<<"|"<<endl;
}
printf("+---+---+---+---+---+---+---+---+\n");
return ;
}

poj 2993 Emag eht htiw Em Pleh(模拟)的更多相关文章

  1. 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0

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

  2. 模拟 POJ 2993 Emag eht htiw Em Pleh

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

  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

    1.Link: http://poj.org/problem?id=2993 2.Content: Emag eht htiw Em Pleh Time Limit: 1000MS   Memory ...

  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 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2578   Accepted: ...

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

  9. Emag eht htiw Em Pleh(imitate)

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

随机推荐

  1. 深入理解jsavascript的作用域

    一. JavaScript声明提前 在JavaScript中如果不创建变量,直接去使用,则报错: console.log(xxoo); // 报错:Uncaught ReferenceError: x ...

  2. leetcode学习笔记--开篇

    1 LeetCode是什么? LeetCode是一个在线的编程测试平台,国内也有类似的Online Judge平台.程序开发人员可以通过在线刷题,提高对于算法和数据结构的理解能力,夯实自己的编程基础. ...

  3. 1030. Travel Plan (30)

    时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A traveler's map gives the dista ...

  4. Mysql 配置主从服务自动同步功能

    1.修改主服务器master:   #vi /etc/my.cnf       [mysqld]       log-bin=mysql-bin   //[必须]启用二进制日志       serve ...

  5. 干货CentOS6.5_Nginx1.40_Php5.57_MySQL5.5.35编译安装全记录

    http://www.unixdo.com/Unix_Linux/CentOS65_Nginx140_Php557_MySQL5535.html 如果是编译升级php,之前做过nginx的虚拟主机配置 ...

  6. easy ui datagrid 增,删,改,查等基本操作

    如下图: ①列表信息图 ②添加信息图 ③修改信息图 html代码: <%@ Page Title="" Language="C#" MasterPageF ...

  7. custom activities

    Useful Sharepoint Designer Custom Workflow Activities http://spdactivities.codeplex.com/ http://stac ...

  8. Mapped Statements collection does not contain value for TaskMapper.selectByPrimaryKey

    Mapped Statements collection does not contain value for后面是什么类什么方法之类的: 错误原因有几种: 1.mapper.xml中没有加入name ...

  9. Apache2.2+php5.4在windows上配置实例

    这几天一直在win8.1上配置apache+php环境,网上看了很多文章,自己又犯了很多错误才配置成功,对新手来说真是有点小难. 自己打算把配置的详细过程写下来,好帮助其他新手快速配置. 在这里参考了 ...

  10. 字符串截取 方法 String b=a.substring(0, a.indexOf("乘坐"));

    String b=a.substring(0, a.indexOf("乘坐"));