| Task: | Monikulmio |
| Sender: | Pinval |
| Submission time: | 2025-11-02 19:44:21 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 28 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 28 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | 7 | details |
| #2 | ACCEPTED | 0.00 s | 7 | details |
| #3 | WRONG ANSWER | 0.00 s | 0 | details |
| #4 | WRONG ANSWER | 0.00 s | 0 | details |
| #5 | ACCEPTED | 0.00 s | 7 | details |
| #6 | RUNTIME ERROR | 0.00 s | 0 | details |
| #7 | RUNTIME ERROR | 0.00 s | 0 | details |
| #8 | ACCEPTED | 0.00 s | 7 | details |
| #9 | RUNTIME ERROR | 0.00 s | 0 | details |
| #10 | RUNTIME ERROR | 0.00 s | 0 | details |
Code
#include <iostream>
#include <vector>
#include <utility>
#include <string>
using namespace std;
int main(){
int n, m, k;
cin >> n >> m >> k;
vector<pair<int, int>> luvut;
vector<string> tuloste(n, string(m, '.'));
for(int i=0; i<k; i+=1){
int x, y;
cin >> y >> x;
luvut.push_back({y, x});
}
for (int i=0; i<k-1; i+=1){
pair ko = luvut[i];
pair se = luvut[i+1];
while(ko.first!=se.first or ko.second!=se.second){
if (ko.first<se.first and ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='\\';
ko.first+=1;
ko.second+=1;
}
else if (ko.first>se.first and ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='\\';
ko.first-=1;
ko.second-=1;
}
else if (ko.first>se.first and ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='/';
ko.first-=1;
ko.second+=1;
}
else if (ko.first<se.first and ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='/';
ko.first+=1;
ko.second-=1;
}
else if (ko.first<se.first){
tuloste[ko.first-1][ko.second-1]='|';
ko.first+=1;
}
else if (ko.first>se.first){
tuloste[ko.first+1][ko.second-1]='|';
ko.first-=1;
}
else if (ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='=';
ko.second+=1;
}
else if (ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='=';
ko.second-=1;
}
}
}
pair ko = luvut[k-1];
pair se = luvut[0];
while(ko.first!=se.first or ko.second!=se.second){
if (ko.first<se.first and ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='\\';
ko.first+=1;
ko.second+=1;
}
else if (ko.first>se.first and ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='\\';
ko.first-=1;
ko.second-=1;
}
else if (ko.first>se.first and ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='/';
ko.first-=1;
ko.second+=1;
}
else if (ko.first<se.first and ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='/';
ko.first+=1;
ko.second-=1;
}
else if (ko.first<se.first){
tuloste[ko.first-1][ko.second-1]='|';
ko.first+=1;
}
else if (ko.first>se.first){
tuloste[ko.first-1][ko.second-1]='|';
ko.first-=1;
}
else if (ko.second<se.second){
tuloste[ko.first-1][ko.second-1]='=';
ko.second+=1;
}
else if (ko.second>se.second){
tuloste[ko.first-1][ko.second-1]='=';
ko.second-=1;
}
}
for (auto i : luvut){
tuloste[i.first-1][i.second-1]='*';
}
for (auto i : tuloste){
cout << i << endl;
}
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: WRONG ANSWER
| input |
|---|
| 20 40 29 8 7 13 2 14 2 9 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 13, col 10: 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 9, col 31: 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: RUNTIME ERROR
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| (empty) |
Test 7 (public)
Verdict: RUNTIME ERROR
| 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: RUNTIME ERROR
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| (empty) |
Test 10 (public)
Verdict: RUNTIME ERROR
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| (empty) |
