Submission #334588

#TimeUsernameProblemLanguageResultExecution timeMemory
334588achibasadzishviliCrtanje (COCI20_crtanje)C++14
40 / 50
1 ms364 KiB
#include<bits/stdc++.h> #define ll long long #define f first #define s second #define pb push_back using namespace std; ll n; char a[205][250]; string s; int main(){ ios::sync_with_stdio(false); cin >> n; ll mx = 0,mn = 0, x = 0; cin >> s; for(int i=0; i<n; i++){ if(s[i] == '+'){ x++; } if(s[i] == '-')x--; mx = max(mx , x); mn = min(mn , x); } x = 0; for(int i=0; i<=200; i++) for(int j=0; j<=200; j++) a[i][j] = '.'; for(int i=0; i<n; i++){ if(s[i] == '+'){ a[x - mn][i] = '/'; x++; } if(s[i] == '-'){ x--; a[x - mn][i] = char(92); } if(s[i] == '=') a[x - mn][i] = '_'; } for(int i=(mx - mn)-1; i>=0; i--){ for(int j=0; j<n; j++) cout << a[i][j]; cout << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...