Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: maxprogoji
Problemset: หินงอก
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-05 10:37:43
#include <iostream>
#include <vector>
using namespace std;
vector<string> sta(int s, int h){
vector<string> r;
int b = 2 * s - 1;
string l = "";
for (int i = 0; i < b + 1; i++){
l += " ";
}
for (int i = 0; i < s; i++){
string p = l;
p[i] = '\\';
p[b - i] = '/';
r.push_back(p);
h--;
}
for (int i = 0; i < h; i++) {
r.push_back(l);
}
return r;
}
int main(){
int n,in;
int max = 0;
cin >> n;
vector<int> d;
vector<vector<string>> out;
for(int i = 0; i < n; i++){
cin >> in;
d.push_back(in);
}
for(int i: d) if(i > max) max = i;
for(int i: d){
out.push_back(sta(i, max));
}
for(int i = 0; i < max; i++){
for(vector<string> j: out){
cout << j[i];
}
cout << endl;
}
}