Submission #677237

# Submission time Handle Problem Language Result Execution time Memory
677237 2023-01-02T15:58:34 Z Alma Crtanje (COCI20_crtanje) C++17
0 / 50
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    string s;
    cin >> n >> s;
    vector<vector<char>> m(n, vector<char>(200, '.'));

    int h = 100;
    for (int i = 0; i < n; i++) {
        if (s[i] == '+') {
            m[i][h] = '/';
            h++;
        }
        else if (s[i] == '-') {
            h--;
            m[i][h] = '\\';
        }
        else if (s[i] == '=') {
            m[i][h] = '_';
        }
    }

    int lo = -1, hi = -1;
    for (int j = 0; j < 200; j++) {
        for (int i = 0; i < n; i++) {
            if (m[i][j] != '.') {
                if (lo == -1) lo = j;
                hi = j;
            }
        }
    }

    for (int j = hi; j >= lo; j--) {
        for (int i = 0; i < n; i++) {
            cout << m[i][j] << ' ';
        }
        cout << '\n';
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Incorrect 1 ms 340 KB Output isn't correct
5 Incorrect 1 ms 340 KB Output isn't correct