Submission

Status:
[PPPPPPPPP]

Score: 100

User: Winkrittapas2550gmail.com

Problemset: ภูเขา

Language: cpp

Time: 0.002 second

Submitted On: 2024-09-27 15:11:37

#include<bits/stdc++.h>
using namespace std;
int main (){
	int a[19],b=0,c,i,n,j,d[i],k[19],f=0,t,p=0;
	cin >> n;
	for (i=0;i<n;i++){
		cin >> a[i];
		if (b<a[i]) b=a[i];
		k[i]=0;
	}
	for (i=b;i>0;i--){
		for (j=0;j<n;j++){
			p=0;
		for (c=1;c<=a[j];c++){
			if (c==i){
				cout << "/";
				k[j]++;
				f++;
			}
			else {
				cout << ".";
			}
		}
			for (t=a[j];t>=1;t--){
				if (f>=1&&p==0&&t+k[j]*2-1==i+1+2*(k[j]-1)){
				    cout << "\\" ;
				    p++;
			    }
			    else {
				cout << ".";
			}
		    }
		}
		cout << endl;
	}
}