| Task: | Monikulmio |
| Sender: | whoissanttu |
| Submission time: | 2025-11-05 21:24:15 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 63 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 63 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 7 | details |
| #2 | ACCEPTED | 0.00 s | 7 | details |
| #3 | ACCEPTED | 0.00 s | 7 | details |
| #4 | ACCEPTED | 0.00 s | 7 | details |
| #5 | ACCEPTED | 0.00 s | 7 | 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.00 s | 7 | details |
| #10 | ACCEPTED | 0.01 s | 7 | details |
Compiler report
input/code.cpp: In function 'int strToNumP1(std::string)':
input/code.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
14 | for (int i = 0; i < size(a); i++)
| ~~^~~~~~~~~
input/code.cpp:36:9: warning: unused variable 'P2' [-Wunused-variable]
36 | int P2 = std::stoll(p2);
| ^~
input/code.cpp:37:9: warning: unused variable 'P3' [-Wunused-variable]
37 | int P3 = std::stoll(p3);
| ^~
input/code.cpp: In function 'int strToNumP2(std::string)':
input/code.cpp:49:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
49 | for (int i = 0; i < size(a); i++)
| ~~^~~~~~~~~
input/code.cpp:70:9: warning: unused variable 'P1' [-Wunused-variable]
70 |...Code
#include <iostream>
#include <string>
int strToNumP1(std::string a)
{
int s = 1;
std::string f = "u";
std::string d = "o";
// std::string para;
// std::getline(std::cin, para);
for (int i = 0; i < size(a); i++)
{
if (isspace(a[i]))
{
if (s == 1)
{
a[i] = 'u';
s++;
}
else
a[i] = 'o';
}
continue;
}
int w = a.find(f);
int e = a.find(d);
std::string p1 = a.substr(0, w);
std::string p2 = a.substr(w + 1, e - w);
std::string p3 = a.substr(e + 1, size(a) - 1);
int P1 = std::stoll(p1);
int P2 = std::stoll(p2);
int P3 = std::stoll(p3);
return P1;
}
int strToNumP2(std::string a)
{
int s = 1;
std::string f = "u";
std::string d = "o";
// std::string para;
// std::getline(std::cin, para);
for (int i = 0; i < size(a); i++)
{
if (isspace(a[i]))
{
if (s == 1)
{
a[i] = 'u';
s++;
}
else
a[i] = 'o';
}
continue;
}
int w = a.find(f);
int e = a.find(d);
std::string p1 = a.substr(0, w);
std::string p2 = a.substr(w + 1, e - w);
std::string p3 = a.substr(e + 1, size(a) - 1);
int P1 = std::stoll(p1);
int P2 = std::stoll(p2);
int P3 = std::stoll(p3);
return P2;
}
int strToNumP3(std::string a)
{
int s = 1;
std::string f = "u";
std::string d = "o";
// std::string para;
// std::getline(std::cin, para);
for (int i = 0; i < size(a); i++)
{
if (isspace(a[i]))
{
if (s == 1)
{
a[i] = 'u';
s++;
}
else
a[i] = 'o';
}
continue;
}
int w = a.find(f);
int e = a.find(d);
std::string p1 = a.substr(0, w);
std::string p2 = a.substr(w + 1, e - w);
std::string p3 = a.substr(e + 1, size(a) - 1);
int P1 = std::stoll(p1);
int P2 = std::stoll(p2);
int P3 = std::stoll(p3);
return P3;
}
int cornerCoord1(std::string a)
{
std::string f = "u";
// std::string para;
// std::getline(std::cin, para);
for (int i = 0; i < size(a); i++)
{
if (isspace(a[i]))
{
a[i] = 'u';
}
continue;
}
int w = a.find(f);
std::string p1 = a.substr(0, w);
std::string p2 = a.substr(w + 1, size(a) - 1);
int P1 = std::stoll(p1);
int P2 = std::stoll(p2);
return P1;
}
int cornerCoord2(std::string a)
{
std::string f = "u";
// std::string para;
// std::getline(std::cin, para);
for (int i = 0; i < size(a); i++)
{
if (isspace(a[i]))
{
a[i] = 'u';
}
continue;
}
int w = a.find(f);
std::string p1 = a.substr(0, w);
std::string p2 = a.substr(w + 1, size(a) - 1);
int P1 = std::stoll(p1);
int P2 = std::stoll(p2);
return P2;
}
int main()
{
std::string para;
std::getline(std::cin, para);
int n = strToNumP1(para);
int m = strToNumP2(para);
int r = strToNumP3(para);
char A[n][m] = {'.'};
int B[2][r];
for (int i = 0; i < r; i++)
{
std::string crn;
std::getline(std::cin, crn);
int p = cornerCoord1(crn);
int q = cornerCoord2(crn);
A[p - 1][q - 1] = '*';
B[0][i] = p;
B[1][i] = q;
}
for (int R = 0; R < r; R++)
{
if (R + 1 < r && B[0][R] > B[0][R + 1] && B[1][R] > B[1][R + 1]) // B[0][j] korkeus ja B[1][j] on leveys
{
for (int u = 1; u < B[0][R] - B[0][R + 1] && u < B[1][R] - B[1][R + 1]; u++)
{
A[B[0][R] - u - 1][B[1][R] - u - 1] = '\\';
}
}
else if (R + 1 < r && B[0][R] < B[0][R + 1] && B[1][R] > B[1][R + 1])
{
for (int u = 1; u < B[0][R + 1] - B[0][R] && u < B[1][R] - B[1][R + 1]; u++)
{
A[B[0][R] + u - 1][B[1][R] - u - 1] = '/';
}
}
else if (R + 1 < r && B[0][R] < B[0][R + 1] && B[1][R] < B[1][R + 1])
{
for (int u = 1; u < B[0][R + 1] - B[0][R] && u < B[1][R + 1] - B[1][R]; u++)
{
A[B[0][R] + u - 1][B[1][R] + u - 1] = '\\';
}
}
else if (R + 1 < r && B[0][R] > B[0][R + 1] && B[1][R] < B[1][R + 1])
{
for (int u = 1; u < B[0][R] - B[0][R + 1] && u < B[1][R + 1] - B[1][R]; u++)
{
A[B[0][R] - u - 1][B[1][R] + u - 1] = '/';
}
}
else if (R + 1 < r && B[0][R] == B[0][R + 1] && B[1][R] < B[1][R + 1])
{
for (int u = 1; u < B[1][R + 1] - B[1][R]; u++)
{
A[B[0][R] - 1][B[1][R] + u - 1] = '=';
}
}
else if (R + 1 < r && B[0][R] == B[0][R + 1] && B[1][R] > B[1][R + 1])
{
for (int u = 1; u < B[1][R] - B[1][R + 1]; u++)
{
A[B[0][R] - 1][B[1][R] - u - 1] = '=';
}
}
else if (R + 1 < r && B[0][R] > B[0][R + 1] && B[1][R] == B[1][R + 1])
{
for (int u = 1; u < B[0][R] - B[0][R + 1]; u++)
{
A[B[0][R] - u - 1][B[1][R] - 1] = '|';
}
}
else if (R + 1 < r && B[0][R] < B[0][R + 1] && B[1][R] == B[1][R + 1])
{
for (int u = 1; u < B[0][R + 1] - B[0][R]; u++)
{
A[B[0][R] + u - 1][B[1][R] - 1] = '|';
}
}
else if (B[0][R] > B[0][0] && B[1][R] > B[1][0] && R + 1 >= r) // B[0][j] korkeus ja B[1][j] on leveys
{
for (int u = 1; u < B[0][R] - B[0][0] && u < B[1][R] - B[1][0]; u++)
{
A[B[0][R] - u - 1][B[1][R] - u - 1] = '\\';
}
}
else if (B[0][R] < B[0][0] && B[1][R] > B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[0][0] - B[0][R] && u < B[1][R] - B[1][R + 1]; u++)
{
A[B[0][R] + u - 1][B[1][R] - u - 1] = '/';
}
}
else if (B[0][R] < B[0][0] && B[1][R] < B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[0][0] - B[0][R] && u < B[1][0] - B[1][R]; u++)
{
A[B[0][R] + u - 1][B[1][R] + u - 1] = '\\';
}
}
else if (B[0][R] > B[0][0] && B[1][R] < B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[0][R] - B[0][0] && u < B[1][0] - B[1][R]; u++)
{
A[B[0][R] - u - 1][B[1][R] + u - 1] = '/';
}
}
else if (B[0][R] == B[0][0] && B[1][R] < B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[1][0] - B[1][R]; u++)
{
A[B[0][R] - 1][B[1][R] + u - 1] = '=';
}
}
else if (B[0][R] == B[0][0] && B[1][R] > B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[1][R] - B[1][0]; u++)
{
A[B[0][R] - 1][B[1][R] - u - 1] = '=';
}
}
else if (B[0][R] > B[0][0] && B[1][R] == B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[0][R] - B[0][0]; u++)
{
A[B[0][R] - u - 1][B[1][R] - 1] = '|';
}
}
else if (B[0][R] < B[0][0] && B[1][R] == B[1][0] && R + 1 >= r)
{
for (int u = 1; u < B[0][0] - B[0][R]; u++)
{
A[B[0][R] + u - 1][B[1][R] - 1] = '|';
}
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if (A[i][j] != '*' && A[i][j] != '=' && A[i][j] != '|' && A[i][j] != '/' && A[i][j] != '\\' && A[i][j] != '#')
{
A[i][j] = '.';
}
std::cout << A[i][j];
}
std::cout << "\n";
}
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 |
|---|
| ......... ....*.... .../.\... ../...\.. .*.....*. ... |
Feedback: Lines are drawn correctly. Incorrect fill character on row 3, col 5: expected '#', got '.'
Test 2 (public)
Verdict: ACCEPTED
| input |
|---|
| 20 40 4 5 10 5 30 15 30 15 10 |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Lines are drawn correctly. Incorrect fill character on row 6, col 11: expected '#', got '.'
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 4, col 30: 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 4, col 10: 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 4, col 20: 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 3, col 3: 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 1, col 97: 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: 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 2, col 6: expected '#', got '.'
