Submission #473881

# Submission time Handle Problem Language Result Execution time Memory
473881 2021-09-16T11:14:16 Z Ahmed57 Crtanje (COCI20_crtanje) C++14
0 / 50
1 ms 332 KB
#include<bits/stdc++.h>
using namespace std;
string s = "\\";
int main(){
    int n;
    cin>>n;
    char arr[n];
    for(int i = 0;i<n;i++){
        cin>>arr[i];
    }
    char gr[400][n];
    memset(gr,'.',sizeof gr);
    int x = 200,y = 0;
    int mi = 1e4 , ma = 0;
    for(int i = 0;i<n;i++){
        if(arr[i]=='+'){
            gr[x][y] = '/';
            if(i<n-1&&arr[i+1]=='-'){
                y++;
            }else{
                x--;y++;
            }
        }else if(arr[i]=='-'){
            gr[x][y] = s[0];
            if(i<n-1&&(arr[i+1]=='+'||arr[i+1]=='=')){
                y++;
            }else{
                x++;y++;
            }
        }else{
            gr[x][y] = '_';
            y++;
        }
        mi = min(mi,x);
        ma = max(ma,x);
    }
    for(int i = mi;i<=ma;i++){
        for(int j = 0;j<n;j++){
            cout<<gr[i][j];
        }
        cout<<"\n";
    }
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Incorrect 1 ms 204 KB Output isn't correct
5 Incorrect 1 ms 332 KB Output isn't correct