| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 334591 | achibasadzishvili | Crtanje (COCI20_crtanje) | C++14 | 1 ms | 364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 = -1,mn = 1, x = 0;
cin >> s;
for(int i=0; i<n; i++){
if(s[i] == '+'){
mx = max(mx , x);
mn = min(mn , x);
x++;
}
if(s[i] == '-'){
x--;
mx = max(mx , x);
mn = min(mn , x);
}
if(s[i] == '='){
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); i>=0; i--){
for(int j=0; j<n; j++)
cout << a[i][j];
cout << '\n';
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
