# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473761 | 2021-09-16T08:31:32 Z | MamdouhN | Crtanje (COCI20_crtanje) | C++17 | 1 ms | 332 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 1 ms | 332 KB | Output is correct |
4 | Correct | 1 ms | 332 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |