| Task: | Monikulmio |
| Sender: | worst |
| Submission time: | 2025-10-27 16:12:12 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 41 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 41 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 10 | details |
| #2 | ACCEPTED | 0.00 s | 10 | details |
| #3 | WRONG ANSWER | 0.00 s | 0 | details |
| #4 | WRONG ANSWER | 0.00 s | 0 | details |
| #5 | WRONG ANSWER | 0.00 s | 0 | details |
| #6 | ACCEPTED | 0.00 s | 7 | details |
| #7 | WRONG ANSWER | 0.00 s | 0 | details |
| #8 | ACCEPTED | 0.00 s | 7 | details |
| #9 | ACCEPTED | 0.01 s | 7 | details |
| #10 | WRONG ANSWER | 0.00 s | 0 | details |
Code
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, m, k;
cin >> n >> m >> k;
vector<vector<char>> v(n, vector<char>(m, '.'));
vector<pair<int, int>> l(k);
for (int i = 0; i < k; i++) {
int x, y;
cin >> x >> y;
x--;
y--;
l[i].first = x;
l[i].second = y;
v[x][y] = '*';
}
for (int i = 0; i < k; i++) {
int next = (i + 1) % k;
// connect l[i] and l[i + 1]
if (l[i].first == l[next].first) {
for (int j = min(l[i].second, l[next].second) + 1; j < max(l[i].second, l[next].second); j++) {
v[l[i].first][j] = '=';
}
} else if (l[i].second == l[next].second) {
for (int j = min(l[i].first, l[next].first) + 1; j < max(l[i].first, l[next].first); j++) {
v[j][l[i].second] = '|';
}
} else {
int y = l[i].first;
int x = l[i].second;
char sp;
while (abs(x - l[next].second) != 1) {
if (y < l[next].first) {
y++;
sp = '\\';
} else {
y--;
sp = '/';
}
if (x < l[next].second) {
x++;
} else {
x--;
}
v[y][x] = sp;
}
}
}
vector<bool> can(n, false);
for (int i = 0; i < n; i++) {
int c = 0;
for (int j = 0; j < m; j++) {
if (v[i][j] != '.') {
c++;
}
}
if (c >= 2) {
can[i] = true;
}
}
for (int i = 0; i < n; i++) {
if (!can[i]) {
continue;
}
bool in = false;
for (int j = 0; j < m; j++) {
if (v[i][j] != '.') {
if (v[i][j] != '=') {
in = !in;
}
} else {
if (in) {
v[i][j] = '#';
}
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cout << v[i][j];
}
cout << endl;
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
// cout << fixed << setprecision(6) << endl;
int t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}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: WRONG ANSWER
| 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: WRONG ANSWER
| input |
|---|
| 20 40 14 5 12 5 25 8 28 13 28 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 4, col 27: expected '\', got '/'
Test 5 (public)
Verdict: WRONG ANSWER
| 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: 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: WRONG ANSWER
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 10, col 8: expected '\', got '/'
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 2, col 11: expected '#', got '.'
Test 10 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| ...*====*........................ |
Feedback: Incorrect character on row 2, col 5: expected '\', got '/'
