Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Nuttykub

Problemset: หินงอก

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-05 18:44:01

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

int main(){
    ll n;
    cin >> n;
    vector<int> vec;
    int mx=0,row=0;
    for (int i = 0;i < n;i++){
        int a;
        cin >> a;
        vec.push_back(a);
        if (mx<a) mx = a; 
    }

    int space_mid,space_edge;
    for (int i = 0;i < mx;i++){
        for (int j = 0;j < n;j++){
            space_mid=vec[j]-1-i;
            space_edge=i;
            if (space_mid<0) {
                for (int i = 0;i < vec[j];i++) cout << "  "; // ถ้ามันถึง \/ แล้ว
                continue;
            }
            for (int k = 0;k<space_edge;k++) cout << " "; 
            cout << "\\";
            for (int k = 0;k < space_mid;k++) cout << "  ";
            cout << "/";
            for (int k = 0;k<space_edge;k++) cout << " ";
        }
        cout << endl;
    }
}/*
    \/\  /\      /
       \/  \    /
            \  /
             \/
                    
    n=1 n=2  n=4

*/