| Task: | Monikulmio |
| Sender: | OnlyBitUseless |
| Submission time: | 2025-10-28 11:05:32 +0200 |
| Language: | C |
| Status: | READY |
| Result: | 88 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 88 |
| 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 | 7 | 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 | 7 | details |
| #9 | ACCEPTED | 0.00 s | 7 | details |
| #10 | ACCEPTED | 0.00 s | 7 | details |
Compiler report
input/code.c: In function 'main':
input/code.c:5:5: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
5 | scanf("%d %d %d", &n, &m, &k);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input/code.c:26:13: warning: 'yl' may be used uninitialized in this function [-Wmaybe-uninitialized]
26 | int dy = y - yl;
| ^~
input/code.c:62:21: warning: 'y0' may be used uninitialized in this function [-Wmaybe-uninitialized]
62 | if (x0 == x && y0 == y) break;
| ~~~~~~~~^~~~~~~~~~Code
#include <stdio.h>
int main(){
int n, m, k;
scanf("%d %d %d", &n, &m, &k);
int mx[n][m];
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
mx[i][j] = '#';
}
}
int x0 = -1, y0, xl = -1, yl, x,y;
while (scanf("%d %d", &x, &y) == 2){
if (x0 < 0) {
x0 = x;
y0 = y;
}
mx[x-1][y-1] = '*';
int dy = y - yl;
int dx = x - xl;
while (!(xl == x) || !(yl == y)) {
if (xl < 0 || yl < 0) break;
xl += xl > x ? -1 : xl < x ? 1 : 0;
yl += yl > y ? -1 : yl < y ? 1 : 0;
if (xl == x && yl == y) break;
if (dx == 0) {
mx[xl - 1][yl - 1] = '=';
continue;
}
if (dy/dx > 0) {
mx[xl - 1][yl - 1] = '\\';
} else if (dy/dx < 0) {
mx[xl - 1][yl - 1] = '/';
} else {
mx[xl - 1][yl - 1] = '|';
}
}
xl = x;
yl = y;
}
int dy = y0 - y;
int dx = x0 - x;
while (!(x0 == x) || !(y0 == y)) {
x += x > x0 ? -1 : x < x0 ? 1 : 0;
y += y > y0 ? -1 : y < y0 ? 1 : 0;
if (x0 == x && y0 == y) break;
if (dx == 0) {
mx[x - 1][y -1] = '=';
continue;
}
if (dy/dx > 0) {
mx[x - 1][y - 1] = '\\';
} else if (dy/dx < 0) {
mx[x - 1][y - 1] = '/';
} else {
mx[x - 1][y - 1] = '|';
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (mx[i][j] == '#') {
if ((i == 0 || i == n - 1) || (j == 0 || j == m-1)) {
mx[i][j] = '.';
continue;
}
if (mx[i][j-1] == '.' || mx[i-1][j] == '.') mx[i][j] = '.';
}
}
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (mx[n-i][m-j] == '#') {
if (mx[n-i][m-j+1] == '.' || mx[n-i+1][m-j] == '.') mx[n-i][m-j] = '.';
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
printf("%c", mx[i][j]);
}
printf("\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 |
|---|
| ................................. |
Feedback: Lines are drawn correctly. Incorrect fill character on row 6, col 14: expected '.', got '#'
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 |
|---|
| ................................. |
Feedback: Lines are drawn correctly. Incorrect fill character on row 18, col 9: 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: 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 4, col 18: expected '.', got '#'
