File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 69
69
70
70
| # | ☆ | Problem | Note |
71
71
| :-: | :----: | :------------------------------------------------------------------------------------------------------------------ | :------------------------ |
72
- | 01 | | [ Baekjoon-11050 이항 계수 1] ( https://github.com/Seogeurim/Algorithm-practice/blob/master/src/Combination/P11050 ) | |
72
+ | 01 | | [ Baekjoon-11050 이항 계수 1] ( https://github.com/Seogeurim/Algorithm-practice/blob/master/src/Combination/P11050 ) | |
73
+ | 02 | | [ Baekjoon-11051 이항 계수 2] ( https://github.com/Seogeurim/Algorithm-practice/blob/master/src/Combination/P11051 ) | DP |
Original file line number Diff line number Diff line change
1
+ package Combination .P11051 ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .InputStreamReader ;
5
+ import java .util .StringTokenizer ;
6
+
7
+ public class Main {
8
+
9
+ static int N ,K ;
10
+ static int combis [][];
11
+
12
+ public static void main (String [] args ) throws Exception {
13
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
14
+ StringTokenizer st = new StringTokenizer (br .readLine ());
15
+
16
+ N = Integer .parseInt (st .nextToken ());
17
+ K = Integer .parseInt (st .nextToken ());
18
+
19
+ combis = new int [N +1 ][K +1 ];
20
+ for (int i = 1 ; i <= N ; i ++) {
21
+ for (int j = 0 ; j <= K ; j ++) {
22
+ if (j == 0 || i == j )
23
+ combis [i ][j ] = 1 ;
24
+ else combis [i ][j ] = (combis [i -1 ][j -1 ] + combis [i -1 ][j ]) % 10007 ;
25
+ }
26
+ }
27
+
28
+ System .out .println (combis [N ][K ]);
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments