File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 6161| # | โ | Problem | Note |
6262| :-: | :----: | :------------------------------------------------------------------------------------------------------------------ | :------------------------ |
6363| 01 | | [ GCD Example] ( https://github.com/Seogeurim/Algorithm-practice/blob/master/src/GCD/GCDTest.java ) | |
64- | 02 | | [ Baekjoon-14476 ์ต๋๊ณต์ฝ์ ํ๋ ๋นผ๊ธฐ] ( https://github.com/Seogeurim/Algorithm-practice/tree/master/src/GCD/P14476 ) | ๋์ ํฉ |
64+ | 02 | | [ Baekjoon-14476 ์ต๋๊ณต์ฝ์ ํ๋ ๋นผ๊ธฐ] ( https://github.com/Seogeurim/Algorithm-practice/tree/master/src/GCD/P14476 ) | ๋์ ํฉ |
65+
66+ ## Combinatorics
67+
68+ ### Combination
69+
70+ | # | โ | Problem | Note |
71+ | :-: | :----: | :------------------------------------------------------------------------------------------------------------------ | :------------------------ |
72+ | 01 | | [ Baekjoon-11050 ์ดํญ ๊ณ์ 1] ( https://github.com/Seogeurim/Algorithm-practice/blob/master/src/Combination/P11050 ) | |
Original file line number Diff line number Diff line change 1+ package Combination .P11050 ;
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+
11+ public static void main (String [] args ) throws Exception {
12+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
13+ StringTokenizer st = new StringTokenizer (br .readLine ());
14+
15+ N = Integer .parseInt (st .nextToken ());
16+ K = Integer .parseInt (st .nextToken ());
17+
18+ System .out .println (combination (N , K ));
19+ }
20+
21+ static int combination (int n , int k ) {
22+ if (k == 0 || n == k )
23+ return 1 ;
24+ return combination (n -1 , k -1 ) + combination (n -1 , k );
25+ }
26+ }
You canโt perform that action at this time.
0 commit comments