| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1333432 | ahmetlbktd4 | Crtanje (COCI20_crtanje) | C++20 | 1 ms | 348 KiB |
#include "bits/stdc++.h"
using namespace std;
const int N = 201;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
string s;
cin >> s;
char p[N][N];
for (int i = 0;i <= N;i++){
for (int j = 0;j <= N;j++){
p[i][j] = '.';
}
}
int m = 100;
int mn = 2e5,mx = -2e5;
for (int i = 0;i < n;i++){
if (s[i] == '+'){
mn = min(mn,m);
mx = max(mx,m);
p[m][i] = '/';
m--;
}
if (s[i] == '-'){
m++;
p[m][i] = '\\';
mn = min(mn,m);
mx = max(mx,m);
}
if (s[i] == '='){
mn = min(mn,m);
mx = max(mx,m);
p[m][i] = '_';
}
}
for (int i = mn;i <= mx;i++){
for (int j = 0;j < n;j++){
cout << p[i][j] << " ";
}
cout << "\n";
}
}Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
