Submission #1039060

# Submission time Handle Problem Language Result Execution time Memory
1039060 2024-07-30T11:57:44 Z alexander707070 Costinland (info1cup19_costinland) C++14
92 / 100
1 ms 604 KB
#include<bits/stdc++.h>
using namespace std;

long long k;

int x,y;
char s[100][100];

void build(int t){
    if(t==2){
        s[x][y]='X';
    }
    if(t==3){
        s[x][y]=s[x+1][y]='X';
    }
    if(t==4){
        s[x][y]=s[x+1][y]=s[x][y+1]='X';
    }
    if(t==5){
        s[x][y]=s[x+1][y]=s[x][y+1]=s[x][y+2]='X';
    }

    if(t<6){
        x+=2; y+=2; return;
    }

    s[x][y]=s[x+1][y]=s[x][y+1]=s[x+1][y+1]='X';

    if(t==6){
        s[x+2][y]='r'; s[x+2][y+1]='r';
        s[x][y+2]='d'; s[x+1][y+2]='d';
    }

    if(t==7){
        s[x+2][y]='X'; s[x+2][y+1]='r';
        s[x][y+2]='d'; s[x+1][y+2]='d';
    }

    if(t==8){
        s[x+2][y]='X'; s[x+2][y+1]='r';
        s[x][y+2]='X'; s[x+1][y+2]='d';
    }

    if(t==9){
        s[x+2][y]='r'; s[x+2][y+1]='X';
        s[x][y+2]='d'; s[x+1][y+2]='d';
    }

    if(t==10){
        s[x+2][y]='X'; s[x+2][y+1]='X';
        s[x][y+2]='d'; s[x+1][y+2]='d';
    }

    if(t==11){
        s[x+2][y]='X'; s[x+2][y+1]='X';
        s[x][y+2]='X'; s[x+1][y+2]='d';
    }

    x+=2; y+=2;
}

int main(){

    cin>>k;

    x=1; y=1;

    while(k>5){
        build(k%6+6);
        k/=6;
    }

    build(k);

    x++; y++;
    if(x==50){x--;y--;}

    for(int i=1;i<=y;i++)s[x][i]='r';
    for(int i=1;i<=x;i++)s[i][y]='d';
    s[x][y]='.';

    cout<<x<<" "<<y<<"\n";
    for(int i=1;i<=x;i++){
        for(int f=1;f<=y;f++){
            if(s[i][f]==0)s[i][f]='.';
            cout<<s[i][f];
        }
        cout<<"\n";
    }
    

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct! Your size: 4
2 Correct 1 ms 348 KB Correct! Your size: 4
3 Correct 0 ms 348 KB Correct! Your size: 4
4 Partially correct 0 ms 348 KB Partially Correct! Your size: 6
5 Partially correct 1 ms 604 KB Partially Correct! Your size: 6
6 Partially correct 1 ms 348 KB Partially Correct! Your size: 6
7 Partially correct 0 ms 348 KB Partially Correct! Your size: 6
8 Partially correct 0 ms 348 KB Partially Correct! Your size: 6
9 Partially correct 0 ms 348 KB Partially Correct! Your size: 6
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Correct! Your size: 48
2 Correct 0 ms 344 KB Correct! Your size: 48
3 Correct 0 ms 348 KB Correct! Your size: 49
4 Correct 0 ms 348 KB Correct! Your size: 48
5 Correct 1 ms 348 KB Correct! Your size: 48
6 Correct 0 ms 348 KB Correct! Your size: 49
7 Correct 0 ms 348 KB Correct! Your size: 49
8 Correct 0 ms 348 KB Correct! Your size: 48