QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#789547#9621. 连方Hojstyer#WA 0ms3532kbC++202.6kb2024-11-27 20:47:382024-11-27 20:47:42

Judging History

你现在查看的是最新测评结果

  • [2024-11-27 20:47:42]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3532kb
  • [2024-11-27 20:47:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

void solve()
{
    int n;
    cin >> n;
    string a, b;
    cin >> a >> b;

    if (a == b)
    {
        cout << "Yes\n";
        for (int i = 0; i < 7; ++i)
            cout << a << '\n';
        return;
    }
    else
    {
        int p1 = -1, p2 = -1;
        for (int i = 0; i < n; ++i)
        {
            if (a[i] == '.')
                p1 = i;
            if (b[i] == '.')
                p2 = i;
        }

        if (p1 == -1 || p2 == -1)
            cout << "No\n";
        else
        {
            cout << "Yes\n";
            cout << a << "\n";
            string res;
            for (int i = 0; i < n; ++i)
                if (a[i] == '.')
                    res += '#';
                else
                    res += '.';
            cout << res << '\n';
            res.clear();

            for (int i = 0; i < n; ++i)
            {
                if (a[i] == '#')
                    p1 = i;
                if (b[i] == '#')
                    p2 = i;
            }

            for (int i = 0; i < n; ++i)
                if (p1 == i)
                    res += '#';
                else
                    res += '.';
            cout << res << '\n';
            res.clear();

            if (p1 == p2)
            {
                for (int i = 0; i < n; ++i)
                    if (p1 == i)
                        res += '#';
                    else
                        res += '.';
                cout << res << '\n';
                res.clear();
            }
            else
            {
                for (int i = 0; i <= min(p1, p2); ++i)
                    res += '.';
                for (int i = min(p1, p2) + 1; i <= max(p1, p2) - 1; ++i)
                    res += '#';
                for (int i = max(p1, p2); i < n; ++i)
                    res += '.';
                cout << res << "\n";
                res.clear();
            }

            for (int i = 0; i < n; ++i)
                if (p2 == i)
                    res += '#';
                else
                    res += '.';
            res.clear();

            for (int i = 0; i < n; ++i)
                if (b[i] == '.')
                    res += '#';
                else
                    res += '.';
            cout << res << '\n';
            res.clear();
            cout << b << "\n";
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3532kb

input:

5
4
#..#
.##.
5
##.#.
.#.##
6
######
.####.
27
.######.######.####.#.#####
.####...####..#.......#####
10
##########
##########

output:

Yes
#..#
.##.
...#
....
#..#
.##.
Yes
##.#.
..#.#
...#.
.....
#.#..
.#.##
No
Yes
.######.######.####.#.#####
#......#......#....#.#.....
..........................#
..........................#
#....###....##.#######.....
.####...####..#.......#####
Yes
##########
##########
##########
##########
###...

result:

wrong answer Token parameter [name=map] equals to "Yes", doesn't correspond to pattern "[\.#]{1,100000}"