Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Quinruj

Problemset: ลูกเต๋า

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-02 17:41:06

#include <bits/stdc++.h>
using namespace std;

int n,col;  

vector<vector<char>> grid;

void call(int num){
    if (num == 1){
        grid[1][++col] = '*';
        col+=2;
    }
    else if (num == 2){
        grid[1][col] = '*';
        col+=2;
        grid[1][col] = '*';
        col++;
    }
    else if (num == 3){
        col++;
        for (int i = 0;i<3;i++) grid[i][col] = '*';
        col+=2;
    }
    else if (num == 4){
        grid[0][col] = '*';
        grid[2][col] = '*';
        col+=2;
        grid[0][col] = '*';
        grid[2][col] = '*';
        col++;
    }
    else if (num == 5){
        grid[0][col] = '*';
        grid[2][col] = '*';
        col++;
        grid[1][col] = '*';
        col++;
        grid[0][col] = '*';
        grid[2][col] = '*';
        col++;
    }
    else if (num == 6){
        grid[0][col] = '*';
        grid[1][col] = '*';
        grid[2][col] = '*';
        col+=2;
        grid[0][col] = '*';
        grid[1][col] = '*';
        grid[2][col] = '*';
        col++;
    }
    if (col < grid[0].size()) for (int i = 0;i<3;i++) grid[i][col] = '|';
    col++;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    
    string s;cin>>s;
    n = s.size();
    grid.resize(3,vector<char> (4*n-1,' '));
    for (int i = 0;i<n;i++) {
        if (s[i]-'0' > 6){
            cout << "ERROR";return 0;
        }
        call(s[i]-'0');
    }
    for (int i = 0;i<3;i++){
        for (int j = 0;j<grid[0].size();j++){
            cout << grid[i][j];
        }cout << '\n';
    }
}