Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define HERE cerr << "HERE" << endl;
- using ll = long long;
- ///********************
- void setUp() {
- }
- void testCase() {
- int n;
- string in, out;
- cin >> n >> in >> out;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- bool ok = true;
- if (i <= j) {
- for (int k = i; k < j; k++) {
- if (out[k] == 'N' || in[k + 1] == 'N') {
- ok = false;
- }
- }
- } else {
- for (int k = i; k > j; k--) {
- if (out[k] == 'N' || in[k - 1] == 'N') {
- ok = false;
- }
- }
- }
- cout << (ok ? 'Y' : 'N');
- }
- cout << endl;
- }
- }
- signed main() {
- cin.tie(nullptr), cout.tie(nullptr);
- ios::sync_with_stdio(false);//*/
- freopen("text.in", "r", stdin);
- freopen("text.out", "w", stdout);
- ll t(1);
- cin >> t;
- setUp();
- for (ll tt = 1; tt <= t; tt++) {
- cout << "Case #" << tt << ": ";
- cout << '\n';
- testCase();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement