답안 #473778

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
473778 2021-09-16T08:49:20 Z Mr_Ph Crtanje (COCI20_crtanje) C++14
0 / 50
2 ms 716 KB
///made by : Mr_Ph :D
#include<bits/stdc++.h>
#include<unordered_map>
typedef long long ll;
typedef long long int lli;
typedef unsigned long long ull;
using namespace std;
const double PI=acos(-1.0);
const ll mod=(ll)1e9+7;
//int dx[4] = {0, 0, 1, -1};
//int dy[4] = {1, -1, 0, 0};
///the defines :)
#define endl '\n'
#define vi vector<int>
#define vll vector<ll>
#define lower(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define upper(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
///the end of the defines ;)
void solve()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    vector<vector<char>>arr(400,vector<char>(400));
    for(int i=0; i<400; i++)
        for(int k=0; k<400; k++)
            arr[i][k]='.';
    int x=300,y=0;
    int n1=0,n2=INT_MAX;
    for(int i=0; i<s.sz; i++)
    {
        if(s[i]=='+')
        {
            arr[x][y]='/';
            x--;
        }
        else if(s[i]=='-')
        {
            arr[x][y]='\\';
            x++;
        }
        else
            arr[x][y]='_';
        n1=max(n1,x);
        n2=min(n2,x);
        y++;
    }
    for(int i=n2; i<=n1; i++)
    {
        for(int k=0; k<s.sz; k++)
            cout<<arr[i][k];
        cout<<endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(0);
    //freopen("window.in","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1;//int st;
    //cin>>t;//cin>>st;
    while(t--)
        solve();
}

Compilation message

crtanje.cpp: In function 'void solve()':
crtanje.cpp:35:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for(int i=0; i<s.sz; i++)
      |                   ^
crtanje.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |         for(int k=0; k<s.sz; k++)
      |                       ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 460 KB Output isn't correct
2 Incorrect 1 ms 460 KB Output isn't correct
3 Incorrect 1 ms 460 KB Output isn't correct
4 Incorrect 1 ms 476 KB Output isn't correct
5 Runtime error 2 ms 716 KB Execution killed with signal 11