[BOJ 19124] Binomial Coefficient

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 512M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given $n, k$, calculate $\binom{n}{k} = \frac{n!}{k!(n - k)!} \bmod (2^{32})$.

입력 형식

$2$ integers $n, k$ ($1 \leq n \leq 10^{18}, 0 \leq k \leq n$).

출력 형식

A single integer denotes the value.

예제 입력 1

4 2

예제 출력 1

6

예제 입력 2

1000000000 500000000

예제 출력 2

4209467392

Comments

There are no comments at the moment.