| Task: | Monikulmio |
| Sender: | Karjalanp11rakka |
| Submission time: | 2025-10-28 10:53:51 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 100 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 10 | details |
| #2 | ACCEPTED | 0.00 s | 10 | details |
| #3 | ACCEPTED | 0.00 s | 10 | details |
| #4 | ACCEPTED | 0.00 s | 10 | details |
| #5 | ACCEPTED | 0.00 s | 10 | details |
| #6 | ACCEPTED | 0.00 s | 10 | details |
| #7 | ACCEPTED | 0.00 s | 10 | details |
| #8 | ACCEPTED | 0.00 s | 10 | details |
| #9 | ACCEPTED | 0.00 s | 10 | details |
| #10 | ACCEPTED | 0.00 s | 10 | details |
Compiler report
input/code.cpp: In function 'void c(size_t, size_t, size_t, size_t)':
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(x, lx) + 1; i != max(x, lx); ++i)
| ~~^~~~~~~~~~~~~
input/code.cpp:20:37: warning: comparison of integer expressions of different signedness: 'int' and 'const long unsigned int' [-Wsign-compare]
20 | for(int i = min(y, ly) + 1; i != max(y, ly); ++i)
| ~~^~~~~~~~~~~~~
input/code.cpp: In function 'int main()':
input/code.cpp:62:19: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
62 | for(int i {}; i < k; ++i)
| ~~^~~
input/code.cpp:72:12: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-c...Code
#include <bits/stdc++.h>
using namespace std;
vector<vector<char>> t;
vector<vector<int>> q;
size_t n, m, k;
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(ly > y)
++q[lx][ly];
else ++q[x][y];
if(x == lx)
{
for(int i = min(y, ly) + 1; i != max(y, ly); ++i)
{
++q[x][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] = '\\';
++q[x - o][y - o];
}
else if(x < lx && y < ly)
{
t[x + o][y + o] = '\\';
++q[x + o][y + o];
}
else if(x < lx && y > ly)
{
t[x + o][y - o] = '/';
++q[x + o][y - o];
}
else
{
t[x - o][y + o] = '/';
++q[x - o][y + o];
}
}
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> m >> k;
t = vector<vector<char>>(m, vector<char>(n, '.'));
q = vector<vector<int>>(m, vector<int>(n, 0));
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(fx, x, fy, y);
}
else
{
fx = x;
fy = y;
}
lx = x;
ly = y;
}
int f {};
for(size_t j {}; j < n; ++j)
{
int c {};
for(size_t i {}; i < m; ++i)
{
if(t[i][j] == '.')
cout << (((c & 1) == 0) ? '.' : '#');
else
{
c += q[i][j];
cout << t[i][j];
}
}
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 |
|---|
| ................................. |
Test 4 (public)
Verdict: ACCEPTED
| input |
|---|
| 20 40 14 5 12 5 25 8 28 13 28 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Test 5 (public)
Verdict: ACCEPTED
| input |
|---|
| 20 40 12 3 20 7 16 7 9 11 13 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Test 6 (public)
Verdict: ACCEPTED
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Test 7 (public)
Verdict: ACCEPTED
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Test 8 (public)
Verdict: ACCEPTED
| input |
|---|
| 40 60 192 11 3 11 5 10 6 11 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Test 9 (public)
Verdict: ACCEPTED
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| *=====*===*==*................... |
Test 10 (public)
Verdict: ACCEPTED
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| ...*====*........................ |
