summaryrefslogtreecommitdiff
path: root/math/binomial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'math/binomial.cpp')
-rw-r--r--math/binomial.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/math/binomial.cpp b/math/binomial.cpp
index fc6d980..02b27e3 100644
--- a/math/binomial.cpp
+++ b/math/binomial.cpp
@@ -1,8 +1,7 @@
ll calc_binom(ll n, ll k) {
- ll r = 1, d;
if (k > n) return 0;
- // Reihenfolge garantiert Teilbarkeit
- for (d = 1; d <= k; d++) {
+ ll r = 1;
+ for (ll d = 1; d <= k; d++) {// Reihenfolge => Teilbarkeit
r *= n--;
r /= d;
}