File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ ``` java
2+ import java.io.* ;
3+ import java.util.Arrays ;
4+ import java.util.StringTokenizer ;
5+
6+ public class BJ_2225_ 합분해 {
7+
8+ private static final int MOD = 1_000_000_000 ;
9+
10+ private static final BufferedReader br = new BufferedReader (new InputStreamReader (System . in));
11+ private static final BufferedWriter bw = new BufferedWriter (new OutputStreamWriter (System . out));
12+ private static StringTokenizer st;
13+
14+ private static int N , K ;
15+ private static int [] dp;
16+
17+ public static void main (String [] args ) throws IOException {
18+ init();
19+ sol();
20+ }
21+
22+ private static void init () throws IOException {
23+ st = new StringTokenizer (br. readLine());
24+ N = Integer . parseInt(st. nextToken());
25+ K = Integer . parseInt(st. nextToken());
26+
27+ dp = new int [N + 1 ];
28+ Arrays . fill(dp, 1 );
29+ }
30+
31+ private static void sol () throws IOException {
32+ for (int j = 1 ; j < K ; j++ ) {
33+ for (int i = 1 ; i <= N ; i++ ) {
34+ dp[i] = (dp[i - 1 ] + dp[i]) % MOD ;
35+ }
36+ }
37+ bw. write(dp[N ] + " \n " );
38+ bw. flush();
39+ bw. close();
40+ br. close();
41+ }
42+
43+ }
44+ ```
You can’t perform that action at this time.
0 commit comments