Submission #857273

# Submission time Handle Problem Language Result Execution time Memory
857273 2023-10-05T18:24:39 Z SalihSahin Crtanje (COCI20_crtanje) C++14
40 / 50
1 ms 348 KB
#include<bits/stdc++.h>
#define int long long 
using namespace std;

const int mod = 998244353;

int32_t main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;

    vector<vector<char> > a(205, vector<char>(n, '.'));
    int y = 102;
    int mxf = 102, mnf = 102;
    for(int i = 0; i < n; i++){
        if(s[i] == '+'){
            mnf = min(mnf, y);
            mxf = max(mxf, y);
            a[y][i] = '/';
            y--;
        }
        else if(s[i] == '-'){
            y++;
            mnf = min(mnf, y);
            mxf = max(mxf, y);
            a[y][i] = 92;
        }
        else{
            mnf = min(mnf, y);
            mxf = max(mxf, y);
            a[y][i] = '_';
        }
    }

    for(int i = mnf; i <= mxf; i++){
        for(int j = 0; j < n; j++){
            //cout<<" gh "<<endl;
            cout<<a[i][j];
        }
        cout<<endl;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB Output isn't correct