Submission #469533

#TimeUsernameProblemLanguageResultExecution timeMemory
469533ahmeterenCrtanje (COCI20_crtanje)C++14
50 / 50
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; char grid[1005][1005]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; string str; cin >> n >> str; int cur = 0, mx = INT_MIN, mn = INT_MAX; for(int i = 0; i < n; i++) { if(str[i] == '+') { grid[cur + n][i] = '/'; mn = min(mn, cur + n); mx = max(mx, cur + n); cur++; } else if(str[i] == '-') { cur--; grid[cur + n][i] = '\\'; mn = min(mn, cur + n); mx = max(mx, cur + n); } else { grid[cur + n][i] = '_'; mn = min(mn, cur + n); mx = max(mx, cur + n); } } for(int i = mx; i >= mn; i--) { for(int j = 0; j < n; j++) { if(!grid[i][j]) cout << '.'; else cout << grid[i][j]; } cout << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...