https://www.acmicpc.net/problem/2225
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main_bj_2225_합분해 {
static int N,K;
static int[][] dp;
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st=new StringTokenizer(br.readLine()," ");
N=Integer.parseInt(st.nextToken());
K=Integer.parseInt(st.nextToken());
dp=new int[201][201];
for(int i=1; i<=K; i++) {
dp[0][i]=1;
}
for(int i=1; i<=N; i++) {
for(int j=1; j<=K; j++) {
dp[i][j]=(dp[i][j-1]+dp[i-1][j])%1000000000;
}
}
System.out.println(dp[N][K]);
}
}
'알고리즘 문제풀이 > 백준' 카테고리의 다른 글
[백준 2579] 계단오르기(JAVA) (0) | 2020.04.16 |
---|---|
[백준 1753] 최단경로(JAVA/C++) (0) | 2020.04.10 |
[백준 17404] RGB거리2(JAVA) (0) | 2020.04.04 |
[백준 6087] 레이저 통신(JAVA) (0) | 2020.04.03 |
[백준 1072] 게임(JAVA) (2) | 2020.04.02 |
댓글