Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: sulinx

Problemset: หินงอก

Language: cpp

Time: 0.002 second

Submitted On: 2025-11-19 23:40:24

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

int main(){
    int n,maxHeight = 0;
    cin >> n;
    int rock[n];
    for(int i = 0;i<n;i++){
        cin >> rock[i];
        maxHeight = max(maxHeight,rock[i]);
    }

    for(int i = 0;i<maxHeight;i++){
        for(int j = 0;j<n;j++){
            if(rock[j]<=i){
                for(int k=0;k<rock[j]*2;k++){
                    cout << " ";
                }
                continue;
            }
            for(int k = 0;k<rock[j]*2;k++){
                if(k==i) cout<<"\\";
                else if(k+i==rock[j]*2-1) cout << "/";
                else cout << " ";
            }
        }
        cout << "\n";
    }
}