Submission

Status:

PPPPP

Subtask/Task Score:

100/100

Score: 100

User: nik121416

Problemset: หินงอก

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-14 21:34:47

#include <iostream>
using namespace std;

int main(){
    int n ;
    cin >> n;
    int arr[n];
    for(int i = 0 ; i < n; i++){
        cin >> arr[i];
    }
    int mx = 0;
    for(int i = 0;i< n;i++){
        if(arr[i] > mx){
            mx = arr[i];
        }
    }
        for(int i = 0;i<mx;i++){    
            for(int k = 0;k< n;k++){
                for(int j = 0 ; j < arr[k]*2;j++){
                    if(i == j && i < arr[k]){
                        cout <<  "\\";
                    }
                    else if(i+j == (2*arr[k])-1 && i < arr[k]){
                        cout << '/';
                    }
                    else{
                        cout << ' ';
                    }
                }
            }
            cout << '\n';
        }
        
    
}