Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sol2468

Problemset: หินงอก

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-14 02:34:09

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

int n ;
vector<int> arr ;
vector<int> space ;

int main(){
    ios_base::sync_with_stdio(false) ;
    cin.tie(NULL) ;
    cin >> n ;
    for(int i=0 ; i<n ; i++){
        int in1 ;
        cin >> in1 ;
        arr.push_back(in1) ;
        space.push_back(in1*2) ;
    }
    int mx = *max_element(arr.begin(),arr.end()) ;
    for(int i=0 ; i<mx ; i++){
        string prin = "" ;
        for(int j=0 ; j<arr.size() ; j++){
            if(arr[j]==0){
                string temp2(space[j],' ') ;
                prin += temp2 ;
                continue ;
            }
            string temp1((arr[j]-1)*2,' ') ;
            string temp3(i,' ') ;
            prin += temp3 ;
            prin += '\\' ;
            prin += temp1 ;
            prin += '/' ;
            prin += temp3 ;
        }
        cout << prin << "\n" ;
        for(int j=0 ; j<n ; j++){
            if(arr[j]==0)continue ;
            arr[j]-- ;
        }
    }
        
    
    return 0 ;
}