제출 #1348742

#제출 시각아이디문제언어결과실행 시간메모리
1348742branches1029Lego Wall (EGOI22_legowall)C++20
0 / 100
0 ms344 KiB
#include <stdio.h>

int main()
{
    int i,j,k;
    int s,t;
    int w,h;
    
    scanf("%d",&w);
    scanf("%d",&h);

    int C[h+1][h+1];

    for(i=0;i<h+1;i++){
        for(j=0;j<i+1;j++){
            if(j==0){ 
                C[i][j]=1;
            }else{
                t=C[i][j-1]*(i-j+1);
                C[i][j]=t/j;
            }
        }
    }

    int a[w+1][h+1]; 

    a[1][0]=1;

    for(i=2;i<w+1;i++){
        for(j=1;j<h+1;j++){
            s=0;
            for(k=0;k<h-j+1;k++){
                s+=a[i-1][k]*C[h-k][j];
            }
            a[i][j]=s;
        }
    }

    int W=0;
    for(i=0;i<h+1;i++){
        W+=a[w][i];
    }

    printf("%d",W);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d",&w);
      |     ~~~~~^~~~~~~~~
Main.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d",&h);
      |     ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...