#include <stdio.h>

int dp[201][201];
const int mod=1000000000;
int bottom_up(int n, int k) {
    //기저 세로
    for(int i=1; i<=n; i++) {
        dp[i][1]=1;
    }
    //가로
    for(int i=0; i<=k; i++) {
        dp[0][i]=1;
    }
    //잘몬된 기저임
    // for(int i=1; i<=k; i++) {
    //     dp[1][i]=i;
    // }

    

    for(int i=1; i<=n; i++) {
        for(int j=2; j<=k; j++) {
            dp[i][j]=(dp[i][j-1]+dp[i-1][j])%mod;
        }
    }
    return dp[n][k]%mod;
}


int main() {
    int n,k;
    scanf("%d %d",&n, &k);
    printf("%d",bottom_up(n,k));
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: