Submission details
Task:Monikulmio
Sender:aatukaj
Submission time:2025-10-27 00:14:23 +0200
Language:C++ (C++17)
Status:READY
Result:27
Feedback
groupverdictscore
#127
Test results
testverdicttimescore
#1ACCEPTED0.00 s10details
#2ACCEPTED0.00 s10details
#30.00 s0details
#40.00 s0details
#50.00 s0details
#60.00 s0details
#70.00 s0details
#80.00 s0details
#9ACCEPTED0.00 s7details
#100.00 s0details

Code

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

using ll = long long;
#define all(v) begin(v), end(v)


char g[102][102];


void solve() {
    int n, m, k;
    cin >> n >> m >> k;
    vector<array<int, 2>> pts(k);
    for (int i=0; i<k; i++) {
        int y, x;
        cin >> y >> x;
        pts[i] = {y, x};
    }
    pts.push_back(pts[0]);
    memset(g, '#', sizeof g);
    for (int i=0; i<k; i++) {
        auto [ay, ax] = pts[i];
        auto [by, bx] = pts[i+1];
        if (ay>by || ax>bx) {
            swap(ay, by);
            swap(ax, bx);
        }

        if (ay==by) {
            for (int j=ax; j<=bx; j++) g[ay][j] = '=';
        } else if (ax==bx) {
            for (int j=ay; j<=by; j++) g[j][ax] = '|';
        } else {
            if (ax<bx) {
                for (int j=ax; j<=bx; j++) g[ay+j-ax][j] = '\\';
            } else {
                for (int j=bx; j<=ax; j++) g[ay+ax-j][j] = '/';
            }
        }
    }
    for (auto [y, x]: pts) g[y][x] = '*';
    queue<array<int, 2>> q;
    q.push({0, 0});
    g[0][0] = '.';
    while (!q.empty()) {
        auto go = [&](int ni, int nj) {
            if (ni<0 || ni>n || nj<0 || nj>m) return;
            if (g[ni][nj] != '#') return;
            g[ni][nj] = '.';
            q.push({ni, nj});
        };
        auto [i, j] = q.front(); q.pop();
        go(i+1, j);
        go(i-1, j);
        go(i, j+1);
        go(i, j-1);
    }
    for (int i=1; i<=n; i++) {
        for (int j=1; j<=m; j++) {
            cout << g[i][j];
        }
        cout << '\n';
    }
}


int main() {
    cin.tie(0)->sync_with_stdio(0);
    int tc=1;
    // cin >> tc;
    while (tc--) solve();
}

Test details

Test 1 (public)

Verdict: ACCEPTED

input
8 9 5
5 2
2 5
5 8
7 8
...

correct output
.........
....*....
.../#\...
../###\..
.*#####*.
...

user output
.........
....*....
.../#\...
../###\..
.*#####*.
...

Test 2 (public)

Verdict: ACCEPTED

input
20 40 4
5 10
5 30
15 30
15 10

correct output
.................................

user output
.................................

Test 3 (public)

Verdict:

input
20 40 29
8 7
13 2
14 2
9 7
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 4, col 29: expected '/', got '.'

Test 4 (public)

Verdict:

input
20 40 14
5 12
5 25
8 28
13 28
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 14, col 27: expected '/', got '.'

Test 5 (public)

Verdict:

input
20 40 12
3 20
7 16
7 9
11 13
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 4, col 19: expected '/', got '.'

Test 6 (public)

Verdict:

input
9 35 33
2 3
2 8
4 8
4 5
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 7, col 22: expected '#', got '\'

Test 7 (public)

Verdict:

input
30 100 69
6 10
6 14
7 14
7 18
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 12, col 96: expected '/', got '.'

Test 8 (public)

Verdict:

input
40 60 192
11 3
11 5
10 6
11 7
...

correct output
.................................

user output
.................................

Feedback: Incorrect character on row 19, col 7: expected '.', got '\'

Test 9 (public)

Verdict: ACCEPTED

input
50 100 142
1 1
1 7
1 11
1 14
...

correct output
*=====*===*==*...................

user output
*=====*===*==*...................

Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 9: expected '.', got '#'

Test 10 (public)

Verdict:

input
100 100 1000
10 1
4 7
1 4
1 9
...

correct output
...*====*........................

user output
...*====*........................

Feedback: Incorrect character on row 3, col 9: expected '.', got '\'