Submission #1266448

#TimeUsernameProblemLanguageResultExecution timeMemory
1266448canhnam357Crtanje (COCI20_crtanje)C++20
50 / 50
0 ms328 KiB
// source problem : 
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
#define lb lower_bound
#define ub upper_bound
#define MASK(i) (1LL << (i))
const int inf = 1e18;
void ckmax(int& f, int s)
{
    f = (f > s ? f : s);
}
void ckmin(int& f, int s)
{
    f = (f < s ? f : s);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    vector<string> ans(500, string(n, '.'));
    int p = 200;
    for (int i = 0; i < n; i++) {
        if (s[i] == '+') ans[p--][i] = '/';
        else if (s[i] == '-') ans[++p][i] = '\\';
        else ans[p][i] = '_';
    }
    while (ans[0] == string(n, '.')) ans.erase(ans.begin());
    while (ans.back() == string(n, '.')) ans.pop_back();
    for (string t : ans) cout << t << '\n';
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...