Submission

Status:

-----

Subtask/Task Score:

0/100

Score: 0

User: cheeseycheese05

Problemset: หินงอก

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-13 20:49:44

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    if (!(cin >> n)) return 0;

    vector<int> dripstones(n);
    for (int i = 0; i < n; i++) cin >> dripstones[i];

    // Clear screen and home cursor to give us a clean workspace
    cout << "\033[2J\033[1;1H";

    int startColumn = 1;

    for (int dripstone : dripstones) {
        // Draw each dripstone vertically at its specific column
        for (int row = 1; row <= dripstone; row++) {
            // \033[row;colH moves cursor to absolute coordinates
            cout << "\033[" << row << ";" << startColumn << "H" << '\\';
            cout << "\033[" << row << ";" << (startColumn + 1) << "H" << '/';
        }
        startColumn += 2; // Move 2 columns right for the next dripstone
    }

    // Move cursor safely below the tallest possible dripstone at the end
    cout << "\033[20;1H\n"; 
    return 0;
}