题目
题意:
你要构造一个序列满足 其中 代表的是周围有至少一个 的 的总数量, 与之相反。(有单引号的代表是个字符)
思路:
感觉看起来挺复杂的,但是因为 那么一个一个为 ,一个为 就可以解决了,所以只要有一个 在角落就行了。
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <deque>
#include <stack>
using namespace std;
typedef long long ll;
typedef vector<int> veci;
typedef vector<ll> vecl;
typedef pair<int, int> pii;
template <class T>
inline void read(T &ret) {
char c;
int sgn;
if (c = getchar(), c == EOF) return ;
while (c != '-' && (c < '0' || c > '9')) c = getchar();
sgn = (c == '-') ? -1:1;
ret = (c == '-') ? 0:(c - '0');
while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
ret *= sgn;
return ;
}
inline void out(int x) {
if (x > 9) out(x / 10);
putchar(x % 10 + '0');
}
int main() {
int n, m, t;
read(t);
while (t--) {
read(n), read(m);
int cnt = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (i == n && j == m) printf("W");
else printf("B");
}
printf("\n");
}
}
return 0;
}