# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
496440 |
2021-12-21T08:05:53 Z |
PLML |
Crtanje (COCI20_crtanje) |
C++14 |
|
1 ms |
204 KB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,cur,mx,mn;cin >> n;
string s;cin >> s;
cur = mx = mn = 0;
for(int i = 0;i<n;i++){
if(s[i] == '+') cur++;
else if(s[i] == '-') cur--;
mx = max(mx,cur);
mn = min(mn,cur);
}
char a[mx - mn][n];
cur = mx;
char c = '.';
for(int i = 0;i<n;i++){
if(s[i] == '+') cur--;
if(s[i] == '+') c = '/';
else if(s[i] == '-') c = '\\';
else{c = '_';cur--;};
for(int j = 0;j<mx - mn;j++){
if(j == cur) a[j][i] = c;
else a[j][i] = '.';
}
if(s[i] == '-' or s[i] == '=') cur++;
}
for(int i = 0;i<mx - mn;i++){
for(int j = 0;j<n;j++){
cout << a[i][j];
}
cout << endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |