Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: loop

Problemset: หินงอก

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-10 18:31:00

#include <iostream>
#include <string>
using namespace std;

// Each stalactite of length L is a V of width 2L; neighbours touch.
int main() {
    int n, len[25], top = 0;
    cin >> n;
    for (int i = 0; i < n; i++) { cin >> len[i]; if (len[i] > top) top = len[i]; }
    for (int r = 0; r < top; r++) {
        string line = "";
        for (int i = 0; i < n; i++) {
            string part(2 * len[i], ' ');
            if (r < len[i]) { part[r] = '\\'; part[2 * len[i] - 1 - r] = '/'; }
            line += part;
        }
        while (!line.empty() && line[line.size() - 1] == ' ') line.erase(line.size() - 1);
        cout << line << '\n';
    }
    return 0;
}