Submission details
Task:Monikulmio
Sender:Pinval
Submission time:2025-11-02 19:38:14 +0200
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttimescore
#10.00 s0details
#20.01 s0details
#30.01 s0details
#40.01 s0details
#50.01 s0details
#60.01 s0details
#70.02 s0details
#80.02 s0details
#90.01 s0details
#100.09 s0details

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){
            cout <<"ko"<< ko.first << " "<< ko.second << endl;
            cout <<"se"<< se.first << " "<< se.second << endl;
            for (auto i : tuloste){
            
        cout << i << endl;
            }
        cout << " "<< endl;

            if (ko.first<se.first and ko.second<se.second){
                tuloste[ko.first][ko.second]='\\';
                ko.first+=1;
                ko.second+=1;
                cout << "!" << endl;
            }
            else if (ko.first>se.first and ko.second>se.second){
                tuloste[ko.first-1][ko.second]='\\';
                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){
            cout <<"ko"<< ko.first << " "<< ko.second << endl;
            cout <<"se"<< se.first << " "<< se.second << endl;
            for (auto i : tuloste){
            
        cout << i << endl;
            }
        cout << " "<< endl;

            if (ko.first<se.first and ko.second<se.second){
                tuloste[ko.first][ko.second]='\\';
                ko.first+=1;
                ko.second+=1;
                cout << "!" << endl;
            }
            else if (ko.first>se.first and ko.second>se.second){
                tuloste[ko.first-1][ko.second]='\\';
                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:

input
8 9 5
5 2
2 5
5 8
7 8
...

correct output
.........
....*....
.../#\...
../###\..
.*#####*.
...

user output
ko5 2
se2 5
.........
.........
.........
...

Feedback: Incorrect length on line 1: expected 9, got 3

Test 2 (public)

Verdict:

input
20 40 4
5 10
5 30
15 30
15 10

correct output
.................................

user output
ko5 10
se5 30
.................................

Feedback: Incorrect length on line 1: expected 40, got 3

Test 3 (public)

Verdict:

input
20 40 29
8 7
13 2
14 2
9 7
...

correct output
.................................

user output
ko8 7
se13 2
.................................

Feedback: Incorrect length on line 1: expected 40, got 3

Test 4 (public)

Verdict:

input
20 40 14
5 12
5 25
8 28
13 28
...

correct output
.................................

user output
ko5 12
se5 25
.................................

Feedback: Incorrect length on line 1: expected 40, got 3

Test 5 (public)

Verdict:

input
20 40 12
3 20
7 16
7 9
11 13
...

correct output
.................................

user output
ko3 20
se7 16
.................................

Feedback: Incorrect length on line 1: expected 40, got 3

Test 6 (public)

Verdict:

input
9 35 33
2 3
2 8
4 8
4 5
...

correct output
.................................

user output
ko2 3
se2 8
.................................

Test 7 (public)

Verdict:

input
30 100 69
6 10
6 14
7 14
7 18
...

correct output
.................................

user output
ko6 10
se6 14
.................................

Test 8 (public)

Verdict:

input
40 60 192
11 3
11 5
10 6
11 7
...

correct output
.................................

user output
ko11 3
se11 5
.................................

Feedback: Incorrect length on line 1: expected 60, got 4

Test 9 (public)

Verdict:

input
50 100 142
1 1
1 7
1 11
1 14
...

correct output
*=====*===*==*...................

user output
ko1 1
se1 7
.................................

Test 10 (public)

Verdict:

input
100 100 1000
10 1
4 7
1 4
1 9
...

correct output
...*====*........................

user output
ko10 1
se4 7
.................................