Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: หินงอก
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-14 00:01:32
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
int mx = 0;
vector<int> height;
for(int i = 0; i < n; i++) {
int h; cin >> h;
height.push_back(h);
mx = max(mx, h);
}
for(int i = 0; i < mx; i++) {
for(int k = 0; k < n; k++) {
int h = height[k];
for(int j = 0; j < 2*h; j++) {
if(i == j && i < h) {
cout << "\\";
}
else if(i+j == 2*h-1 && j > i) {
cout << "/";
}
else {
cout << " ";
}
}
}
cout << endl;
}
return 0;
}