From e9fcd01ba01b8ad5db5c72d678a0682bd15334e5 Mon Sep 17 00:00:00 2001 From: Paul Jungeblut Date: Mon, 10 Jul 2017 16:44:39 +0200 Subject: Adding code to count the number of inversions. --- math/multInv.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'math/multInv.cpp') diff --git a/math/multInv.cpp b/math/multInv.cpp index 2aedcd6..4e388b8 100644 --- a/math/multInv.cpp +++ b/math/multInv.cpp @@ -2,6 +2,6 @@ ll multInv(ll n, ll p) { ll x, y; extendedEuclid(n, p, x, y); // Implementierung von oben. - x += ((x / p) + 1) * p; + x = ((x % p) + p) % p; return x % p; } -- cgit v1.2.3