Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sense.exe

Problemset: หินงอก

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-02 06:58:17

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

int main() {
    int n,h;
    cin >> n;
    int rows = 0;
    int cols = 0;
    int sum=0;
    int mx=-1;
    vector<vector<char>> v(100,vector<char>(600,' '));
    for(int i=0; i<n; i++) {
        cin >> h;
        sum+=h;
        rows=0;
        mx = max(mx,h);
        for(int j=0; j<h; j++) {
            v[rows][cols] = '\\';
            cols++;
            rows++;
        }
        
        for(int j=0; j<h; j++) {
            rows--;
            v[rows][cols] = '/';
            cols++;
            
        }
    }
    for(int i=0; i<mx; i++) {
        for(int j=0; j<sum*2; j++) {
            cout << v[i][j];
        }
        cout << "\n";
    }
}