답안 #369534

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
369534 2021-02-21T20:43:26 Z sad Costinland (info1cup19_costinland) C++14
20 / 100
41 ms 292 KB
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int c[10][10];int k;
char a[10][19],b[10][10];
int get()
{
    for(int i=1;i<5;i++)for(int j=1;j<5;j++)c[i][j]=0;
    c[1][1]=1;
    for(int i=1;i<=4;i++)
    {
        for(int j=1;j<=4;j++)
        {
            int x=c[i][j];
            /*

            */
            if(a[i][j]=='X')
            {
                c[i][j+1]+=x;
                c[i+1][j]+=x;continue;
            }
            if(a[i][j]=='r')
            {
                c[i][j+1]+=x;continue;
            }
            if(a[i][j]=='d')c[i+1][j]+=x;
        }
    }
    return c[4][4];
}
void go(int x,int y)
{
    if(x==4&&y==4)
    {
        ll u=get();
        if(u==k)
        {
            for(int i=1;i<=4;i++)
            {
                for(int j=1;j<=4;j++)b[i][j]=a[i][j];
            }
            return;
        }
        return;
    }
    if(y==4)
    {
        go(x+1,1);return;
    }
    a[x][y]='X';
    go(x,y+1);
    a[x][y]='d';
    go(x,y+1);
    a[x][y]='r';
    go(x,y+1);
    return;
}
int main()
{
    cin>>k;b[1][1]='w';
    a[1][4]='d';
    a[2][4]='d';
    a[3][4]='d';
    a[4][4]='.';
    a[4][1]='r';
    a[4][2]='r';
    a[4][3]='r';
    go(1,1);cout<<4<<" "<<4<<endl;
    for(int i=1;i<5;i++)
    {
        for(int j=1;j<5;j++)cout<<b[i][j];
        cout<<endl;
    }
}/*
rrXd
rrrd
rrrd
rrrd
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 204 KB Correct! Your size: 4
2 Correct 34 ms 204 KB Correct! Your size: 4
3 Correct 41 ms 204 KB Correct! Your size: 4
4 Correct 40 ms 204 KB Correct! Your size: 4
5 Correct 33 ms 272 KB Correct! Your size: 4
6 Correct 32 ms 204 KB Correct! Your size: 4
7 Correct 32 ms 204 KB Correct! Your size: 4
8 Correct 32 ms 292 KB Correct! Your size: 4
9 Correct 34 ms 204 KB Correct! Your size: 4
# 결과 실행 시간 메모리 Grader output
1 Incorrect 40 ms 204 KB Token "w
2 Halted 0 ms 0 KB -