# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
861130 | vjudge1 | Crtanje (COCI20_crtanje) | C++14 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
const int maxn=105;
char s[maxn],out[maxn<<1][maxn];
int n,max=maxn-1,min=maxn,now=maxn;
int max_(int a,int b){
return a>b?a:b;
}
int min_(int a,int b){
return a<b?a:b;
}
int main(){
scanf("%d\n%s",&n,s+1);
for(int i=1;i<=n;i++){
if(s[i]=='+')out[now][i]='/',max=max_(max,now),min=min_(min,now++);
else if(s[i]=='-')max=max_(max,--now),min=min_(min,now),out[now][i]='\\';
else out[now][i]='_',max=max_(max,now),min=min_(min,now);
}
for(int i=max;i>=min;i--){
for(int j=1;j<=n;j++)putchar(out[i][j]?out[i][j]:'.');
putchar('\n');
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |