# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
375524 | muhi1112 | Crtanje (COCI20_crtanje) | C++17 | 1 ms | 492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define f1 first
#define s2 second
#define INF 99999999
#define ll long long
#define pb push_back
#define fri(a) freopen(a,"r",stdin)
#define fro(a) freopen(a,"w",stdout)
const int N=2e2+5;
int n,a,mn,mx;
string s;
char ans[N][N];
void solve(){
cin>>n>>s;
for(int i=0;i<n;i++){
if(s[i]=='+')a++;
else if(s[i]=='-')a--;
mn=min(a,mn);
mx=max(a,mx);
}
a=-mn;
for(int i=0;i<-mn+mx;i++){
for(int j=0;j<n;j++){
ans[i][j]='.';
}
}
for(int i=0;i<n;i++){
if(s[i]=='+'){
ans[a][i]='/';
a++;
}
else if(s[i]=='=')ans[a][i]='_';
else{
a--;
ans[a][i]='\\';
//cout<<a<<endl;
}
}
for(int i=-mn+mx-1;i>=0;i--){
for(int j=0;j<n;j++){
cout<<ans[i][j];
}
cout<<endl;
}
}
int main(){
//fri("in.txt");
//fro("out.txt");
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |