Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: Kei
Problemset: หินงอก
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-07 12:58:17
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
// space pyramid of height n-1
int n;
cin >> n;
vector<int> thei(n);
for(int& x : thei){
cin >> x;
x=2*(x-1);
}
vector<int> orig=thei;
int themax=(*max_element(thei.begin(),thei.end()));
themax /=2;
for(int i=0;i<=themax;i++){
for(int k=0;k<thei.size();k++){
if(thei[k]<0){
for(int j=orig[k]+2;j--;)cout<<' ';
continue;
}
for(int j=0;j<i;j++) cout<<' ';
cout<<'\\';
for(int j=thei[k];j--;)cout<<' ';
thei[k]-=2;
cout<<'/';
for(int j=0;j<i;j++) cout<<' ';
}
cout<<'\n';
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}