# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473761 | MamdouhN | Crtanje (COCI20_crtanje) | C++17 | 1 ms | 332 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
char ar[300][300];
main()
{
for(int i=0;i<300;i++)for(int j=0;j<300;j++)ar[i][j]='.';
int n;
string s;
cin>>n>>s;
int i = 101 , j=0,mx=0,mn=1e9;
for(int o=0;o<n;o++)
{
char c;
if(s[o]=='+')c='/';
if(s[o]=='-')c='\\';
if(s[o]=='=')c='_';
ar[i][j]=c;
mx=max(mx,i);
mn=min(mn,i);
if(o==n-1)continue;
j++;
if(s[o]=='+'&&s[o+1]!='-')i--;
if(s[o]!='+'&&s[o+1]=='-')i++;
}
for(int i = mn;i<=mx;i++)
{
for(int j=0;j<n;j++)cout<<ar[i][j];
cout<<endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |