Submission #1176994

#TimeUsernameProblemLanguageResultExecution timeMemory
1176994fritlCrtanje (COCI20_crtanje)C++20
50 / 50
0 ms328 KiB
/*******************************
───────────────────────────────
──────────▄▄▄▄▄▄▄▄▄▄▄──────────
─────▄▄▀▀▀▀──────────▀▀▄▄──────
───▄▀───────────────────▀▀▄────
──█────────────────────────█───
─█─────────────────────▄▀▀▀▀▀█▄
█▀────────────────────█────▄███
█─────────────────────█────▀███
█─────▄▀▀██▀▄─────────█───────█
█────█──████─█─────────▀▄▄▄▄▄█─
█────█──▀██▀─█───────────────█─
█────█───────█──────────────▄▀─
█────▀▄─────▄▀──▄▄▄▄▄▄▄▄▄───█──
█──────▀▀▀▀▀────█─█─█─█─█──▄▀──
─█──────────────▀▄█▄█▄█▀──▄▀───
──█──────────────────────▄▀────
───▀▀▀▄──────────▄▄▄▄▄▄▀▀──────
────▄▀─────────▀▀──▄▀──────────
──▄▀───────────────█───────────
─▄▀────────────────█──▄▀▀▀█▀▀▄─
─█────█──█▀▀▀▄─────█▀▀────█──█─
▄█────▀▀▀────█─────█────▀▀───█─
█▀▄──────────█─────█▄────────█─
█──▀▀▀▀▀█▄▄▄▄▀─────▀█▀▀▀▄▄▄▄▀──
█───────────────────▀▄─────────
*******************************/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <unistd.h>
//#include  "functions.h"
//#define int l
#define ll long long
#define ss string
#define cc char
#define vi vector<int>
#define vl vector<int>
#define vp vector<pair<ll , ll>>
#define vs vector<string>
#define dd double
#define bb bool
#define for0 for(ll i=0; i<n; i++)
#define forj for(ll j=0; j<n; j++)
#define fors for(ll i=0; i<k.length(); i++)
#define for1 for(ll i=1; i<=n; i++)
#define ww while
#define endl '\n'
#define pb push_back
#define ppb pop_back
#define f first
#define s second
#define NO cout<<"NO"<<endl
#define YES cout<< "YES"<<endl
#define No cout<< "No"<<endl
#define Yes cout<< "Yes"<<endl
#define b begin
#define e end
#define mll map<ll , ll>
#define MAX 1000000007
#define haha ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(k) k.begin() , k.end()
const long long sz = 1e3 + 5;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
using namespace std;
signed main()
{
    haha;
    ll n;
    ss s;
    cin >> n >> s;
    ll mini = 0, maxi=-1, w = 0;
    for0
    {
        if(s[i] == '-')
        {
            w--;
        }
        mini = min(w,mini);
        maxi = max(w,maxi);
        if(s[i] == '+')
        {
            w++;
        }
    }
    vs a(maxi-mini+1, ss(n, '.'));
    w = 0;
    for0
    {
        if(s[i] == '-')
        {
            w--;
        }
        char c = '_';
        if(s[i] == '+')
        {
            c = '/';
        }
        else if(s[i] == '-')
        {
            c = '\\';
        }
        a[w - mini][i] = c;
        if(s[i] == '+')
        {
            w++;
        }
    }
    for(ll i=a.size()-1; i>=0; i--)
    {
        cout<<a[i]<<endl;
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...