제출 #1176943

#제출 시각아이디문제언어결과실행 시간메모리
1176943JohanCrtanje (COCI20_crtanje)C++20
0 / 50
14 ms2376 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
  
const int MAX = 1e3 + 6;
const int LOG = 25;
const int inf = 1e18;
const int mod = 1e9 + 7;
const int block = 333;
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count
char res[MAX][MAX];
void _(){
  int n;
  string s;
  cin >> n >> s;
  memset(res, '.', sizeof(res));
  int x = 500, y = 1000;
  for(int i = 0; i < s.size(); i++){
    char c = s[i];
    if(c == '+'){
      if(i != 0){
        if(res[x][y] == '/')
          x--, y++;
        else
          y++;
      }
      res[x][y] = '/';
    }
    else if(c == '-'){
      if(i != 0){
        if(res[x][y] == 92)
          x++, y++;
        else
          y++;
      }
      res[x][y] = 92;
    } 
    else if(c == '='){
      if(i != 0){
        if(res[x][y] == 92)  y++;
        else if(res[x][y] == '/')  x--, y++;
        else if(res[x][y] == '_')  y++;
      }
      res[x][y] = '_';
    }
  }
  for(int i = 1; i <= 1000; i++){
    for(int j = 1; j <= 1000; j++){
      cout << res[i][j];
    }
    cout << endl;
  }
} 

signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  // cin >> t;
  while(t--)  _();
}
#Verdict Execution timeMemoryGrader output
Fetching results...