답안 #792336

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
792336 2023-07-25T01:30:45 Z 1075508020060209tc Crtanje (COCI20_crtanje) C++14
0 / 50
1 ms 340 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include<bits/stdc++.h>
//#pragma GCC target("popcnt")
using namespace std;
#define int long long
int n;
string s;
int ar[200005];
int ps[200005];
int chmn;
int chmx;
string ans[500];
signed main()
{

    cin>>n>>s;
    for(int i=1;i<=300;i++){
        ans[i]="*";
        for(int j=1;j<=n;j++){
            ans[i]+=".";
        }
    }

    s="*"+s;
    chmn=0;
    chmx=0;
    for(int i=1;i<=n;i++){
        if(s[i]=='='){
            ps[i]=ps[i-1];
        }
        if(s[i]=='+'){
            ps[i]=ps[i-1]+1;
        }
        if(s[i]=='-'){
            ps[i]=ps[i-1]-1;
        }
        chmn=min(chmn,ps[i]);
        chmx=max(chmx,ps[i]);
    }
    int nwx=chmx+1;
    for(int i=1;i<=n;i++){
        if(s[i]=='='){
            ans[nwx][i]='_';
        }
        if(s[i]=='+'){
            ans[nwx--][i]='/';
        }
        if(s[i]=='-'){
            ans[nwx++][i]='a'-5;
        }
    }
    for(int i=1;i<=chmx-chmn+1;i++){
        for(int j=1;j<=n;j++){
            cout<<ans[i][j];
        }cout<<endl;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Incorrect 1 ms 340 KB Output isn't correct
4 Incorrect 1 ms 328 KB Output isn't correct
5 Incorrect 1 ms 340 KB Extra information in the output file