Submission
Status:
PPPPP
Subtask/Task Score:
100/100
Score: 100
User: PROb221
Problemset: หินงอก
Language: cpp
Time: 0.004 second
Submitted On: 2025-10-07 10:23:07
#include <iostream>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n,i,j,h,MAX=0;
cin >> n;
vector<int> arr(n);
for(i=0;i<n;i++) {
cin >> arr[i];
MAX=max(arr[i],MAX);
}
// for(i=0;i<n;i++) {
// sum=0;
// for(j=0;j<n;j++) {
// if(i-j==0) {
// cout<<"\\";
// }
// else {
// cout<<" ";
// }
// }
// for(j=0;j<n;j++) {
// if(i+j==n-1) {
// cout<<"/";
// }
// else {
// cout<<" ";
// }
// }
// for(j=0;j<n;j++) {
// if(i-j==0) {
// cout<<"\\";
// }
// else {
// cout<<" ";
// }
// }
// for(j=0;j<n;j++) {
// if(i+j==n-1) {
// cout<<"/";
// }
// else {
// cout<<" ";
// }
// }
// cout<<"\n";
// }
//
for(i=0;i<MAX;i++) {//find max layer later
for(h=0;h<n;h++) {
for(j=0;j<arr[h];j++) {
if(i-j==0) {
cout<<"\\";
}
else {
cout<<" ";
}
}
for(j=0;j<arr[h];j++) {
if(i+j==arr[h]-1) {
cout<<"/";
}
else {
cout<<" ";
}
}
}
cout<<"\n";
}
return 0;
}