Submission details
Task:Monikulmio
Sender:Karjalanp11rakka
Submission time:2025-10-27 08:37:13 +0200
Language:C++ (C++20)
Status:READY
Result:69
Feedback
groupverdictscore
#169
Test results
testverdicttimescore
#1ACCEPTED0.00 s10details
#2ACCEPTED0.00 s10details
#3ACCEPTED0.00 s7details
#4ACCEPTED0.00 s7details
#5ACCEPTED0.00 s7details
#6ACCEPTED0.00 s7details
#70.00 s0details
#8ACCEPTED0.00 s7details
#9ACCEPTED0.00 s7details
#10ACCEPTED0.00 s7details

Compiler report

input/code.cpp: In function 'void c(size_t, size_t, size_t, size_t)':
input/code.cpp:7:35: warning: comparison of integer expressions of different signedness: 'int' and 'const long unsigned int' [-Wsign-compare]
    7 |     for(int i = min(x, lx) + 1; i != max(x, lx); ++i)
      |                                 ~~^~~~~~~~~~~~~
input/code.cpp:10:35: warning: comparison of integer expressions of different signedness: 'int' and 'const long unsigned int' [-Wsign-compare]
   10 |     for(int i = min(y, ly) + 1; i != max(y, ly); ++i)
      |                                 ~~^~~~~~~~~~~~~
input/code.cpp: In function 'int main()':
input/code.cpp:32:19: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
   32 |   for(int i {}; i < k; ++i)
      |                 ~~^~~
input/code.cpp:42:12: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compar...

Code

#include <bits/stdc++.h>
using namespace std;
vector<vector<char>> t;
void c(size_t x, size_t lx, size_t y, size_t ly)
{
  if(y == ly)
    for(int i = min(x, lx) + 1; i != max(x, lx); ++i)
      t[i][y] = '=';
  else if(x == lx)
    for(int i = min(y, ly) + 1; i != max(y, ly); ++i)
      t[x][i] = '|';
  else
    for(int o = 1; min(lx, x) + o != max(lx, x); ++o)
    {
      if(x > lx && y > ly)
        t[x - o][y - o] = '\\';
      else if(x < lx && y < ly)
        t[x + o][y + o] = '\\';
      else if(x < lx && y > ly)
        t[x + o][y - o] = '/';
      else t[x - o][y + o] = '/';
    }
}
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  size_t n, m, k;
  cin >> n >> m >> k;
  t = vector<vector<char>>(m, vector<char>(n, '.'));
  size_t lx {}, ly {}, fx {}, fy {};
  for(int i {}; i < k; ++i)
  {
    size_t x, y;
    cin >> y >> x;
    --x;
    --y;
    t[x][y] = '*';
    if(i)
    {
      c(x, lx, y, ly);
      if(i == k - 1)
        c(x, fx, y, fy);
    }
    else
    {
      fx = x;
      fy = y;
    }
    lx = x;
    ly = y;
  }
  int f {};
  for(size_t j {}; j < n; ++j)
  {
    for(size_t i {}; i < m; ++i)
    {
      if(t[i][j] != '.')
      {
        if(j != n - 1)
        {
          int v {};
          if(t[i][j + 1] == '|')
            ++v;
          if(i != n - 1 && t[i + 1][j + 1] != '.')
            ++v;
          if(i != 0 && t[i - 1][j + 1] != '.')
            ++v;
          if(v == 2) f = f ? 0 : 1;
        }
        if(j != 0)
        {
          int v {};
          if(t[i][j - 1] == '|')
            ++v;
          if(i != n - 1 && t[i + 1][j - 1] != '.')
            ++v;
          if(i != 0 && t[i - 1][j - 1] != '.')
            ++v;
          if(v == 2) f = f ? 0 : 1;
        }
        if(t[i][j] != '=') f = f ? 0 : 1;
        cout << t[i][j];
      }
      else if(f) cout << '#';
      else cout << '.';
    }
    cout << '\n';
  }
}

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: ACCEPTED

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

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

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

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

Test 4 (public)

Verdict: ACCEPTED

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

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

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

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

Test 5 (public)

Verdict: ACCEPTED

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

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

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

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

Test 6 (public)

Verdict: ACCEPTED

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

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

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

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

Test 7 (public)

Verdict:

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

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

user output
(empty)

Test 8 (public)

Verdict: ACCEPTED

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

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

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

Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 30: 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 1, col 15: expected '.', got '#'

Test 10 (public)

Verdict: ACCEPTED

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

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

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

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