Submission details
Task:Monikulmio
Sender:R0B0R0BO
Submission time:2025-10-28 16:41:26 +0200
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttimescore
#10.00 s0details
#20.00 s0details
#30.00 s0details
#40.00 s0details
#50.00 s0details
#60.00 s0details
#70.01 s0details
#80.00 s0details
#90.01 s0details
#100.01 s0details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:52:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   52 |     for (int i = 0; i < pisteet.size(); i++)
      |                     ~~^~~~~~~~~~~~~~~~
input/code.cpp:55:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |         if(i == pisteet.size()-1){ continue;}
      |            ~~^~~~~~~~~~~~~~~~~~~

Code

#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <optional>

typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned int uint;

using namespace std;




int main(){

    int n = 0;
    int m = 0;
    int k = 0;

    cin >> n;
    cin >> m;
    cin >> k;

    vector<pair<int,int>> pisteet;

    map<pair<int,int>,char> piiros;

    for (int i = 0; i < k; i++)
    {
        int x,y = 0;
        cin >> y >> x;
        pisteet.push_back(make_pair(x,y));
    }

    pisteet.push_back(pisteet[0]); // Tämä, jotta viimeisen pisteen saa kivasti yhistettyä ensimmäiseen

    for (int y = 1; y <= n + 1; y++)
    {
        for (int x = 1; x <= m + 1; x++)
        {
            piiros[make_pair(x,y)] = 46; // .

        }

    }
    
    for (int i = 0; i < pisteet.size(); i++)
    {
        piiros[pisteet[i]] = 42; //*
        if(i == pisteet.size()-1){ continue;}

        //= eli jos y ovat samat 
        if(pisteet[i].second == pisteet[i+1].second){
            int ero = 1;
            if(signbit(pisteet[i].first - pisteet[i+1].first)){
                ero = -1;
            }
            auto mato = pisteet[i+1];
            for (int j = 0; j < m; j++)
            {
                mato.first += ero;
                if(mato==pisteet[i]) break;
                piiros[mato] = 61; //=
            }
        }

        //| eli jos x ovat samat

                //= eli jos y ovat samat 
        else if(pisteet[i].first == pisteet[i+1].first){
            int ero = 1;
            if(signbit(pisteet[i].second - pisteet[i+1].second)){
                ero = -1;
            }
            auto mato = pisteet[i+1];
            for (int j = 0; j < m; j++)
            {
                mato.second += ero;
                if(mato==pisteet[i]) break;
                piiros[mato] = 124; //|
            }
        }
        else{
            int yEro = 1;
            if(signbit(pisteet[i].second - pisteet[i+1].second)){
                yEro = -1;
            }
            int xEro = 1;
            if(signbit(pisteet[i].first - pisteet[i+1].first)){
                xEro = -1;
            }

            auto mato = pisteet[i+1];
            for (int j = 0; j < m; j++)
            {
                mato.second += yEro;
                mato.first += xEro;
                if(mato==pisteet[i]) break;
                if(signbit(yEro * xEro)){
                    piiros[mato] = 47; // "/"
                }
                else{
                    piiros[mato] = 92; // "\"
                }

            }


        }
        
    }

  //  piiros[make_pair(1,1)] = 43;


    for (int y = 0; y < n + 1; y++)
    {
        for (int x = 0; x < m + 1; x++)
        {
            cout << piiros[make_pair(x,y)];
        }
        cout << "\n";
    }
    


    
    return 0;
}

Test details

Test 1 (public)

Verdict:

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

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

user output

.........
....*....
.../.\...
../...\..
...

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

Test 2 (public)

Verdict:

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

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

user output
...

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

Test 3 (public)

Verdict:

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

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

user output
...

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

Test 4 (public)

Verdict:

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

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

user output
...

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

Test 5 (public)

Verdict:

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

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

user output
...

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

Test 6 (public)

Verdict:

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

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

user output
...

Feedback: Incorrect length on line 1: expected 35, got 36

Test 7 (public)

Verdict:

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

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

user output
...

Feedback: Incorrect length on line 1: expected 100, got 101

Test 8 (public)

Verdict:

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

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

user output
...

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

Test 9 (public)

Verdict:

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

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

user output
...

Feedback: Incorrect length on line 1: expected 100, got 101

Test 10 (public)

Verdict:

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

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

user output
...

Feedback: Incorrect length on line 1: expected 100, got 101