# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
872056 | Onur_Ilgaz | Crtanje (COCI20_crtanje) | C++17 | 1 ms | 600 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fast cin.tie(0)->sync_with_stdio(0);
#define int long long
#define inf ((int)1e18)
using namespace std;
int32_t main(){
fast
string s;
int n;
cin >> n;
cin >> s;
int mx = -inf, mn = inf;
vector <int> v(n);
int val = 0;
for(int i = 0; i < n; i++) {
if(s[i] == '-') val--;
mx = max(val, mx);
mn = min(val, mn);
v[i] = val;
if(s[i] == '+') val++;
}
for(int j = mx; j >= mn; j--) {
for(int i = 0; i < n; i++) {
if(v[i] == j) {
if(s[i] == '+') cout << '/';
if(s[i] == '-') cout << '\\';
if(s[i] == '=') cout << '_';
}
else {
cout << ".";
}
}
cout << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |