题目地址:http://poj.org/problem?id=2993
1 /*
2 题意:与POJ2996完全相反
3 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出字母,否则输出'.'或':'。
4 注意:棋盘的行的顺序是从下到上递增的
5 */
6 #include <cstdio>
7 #include <iostream>
8 #include <algorithm>
9 #include <cstring>
10 #include <cmath>
11 #include <string>
12 #include <map>
13 #include <queue>
14 #include <vector>
15 using namespace std;
16
17 const int MAXN = 1e3 + 10;
18 const int INF = 0x3f3f3f3f;
19 int used[MAXN][MAXN];
20 char a[MAXN][MAXN];
21 map<char, int> m;
22 string s1,s2;
23
24 void print(int tw, int tb)
25 {
26 bool flag = false;
27 for (int i=1; i<=8; ++i)
28 {
29 cout << "+---+---+---+---+---+---+---+---+" << endl;
30 cout << "|";
31 flag = !flag;
32 for (int j=1; j<=8; ++j)
33 {
34 (flag) ? cout << "." : cout << ":";
35 if (!used[i][j]) (flag) ? cout << "." : cout << ":";
36 else
37 {
38 cout << a[i][j];
39 }
40 (flag) ? cout << "." : cout << ":";
41 flag = !flag;
42 cout << "|";
43 }
44 cout << endl;
45 }
46
47 cout << "+---+---+---+---+---+---+---+---+" << endl;
48 }
49
50 void work(void)
51 {
52 int tw = 0, tb = 0;
53 for (int i=7; s1[i]!='