(String[] args)
| 2 | |
| 3 | class Main { |
| 4 | public static void main(String[] args) { |
| 5 | Scanner sc = new Scanner(System.in); |
| 6 | |
| 7 | // 入力 |
| 8 | int n = sc.nextInt(); |
| 9 | int r = sc.nextInt(); |
| 10 | |
| 11 | // 会場の計算 |
| 12 | long fact_n = 1, fact_r = 1, fact_nr = 1; |
| 13 | for (int i = 1; i <= n; i++) fact_n *= i; |
| 14 | for (int i = 1; i <= r; i++) fact_r *= i; |
| 15 | for (int i = 1; i <= n - r; i++) fact_nr *= i; |
| 16 | |
| 17 | // 出力 |
| 18 | System.out.println(fact_n / (fact_r * fact_nr)); |
| 19 | } |
| 20 | } |
nothing calls this directly
no outgoing calls
no test coverage detected