From cef5b16480b1a2009fab7cad1b4d92974fc911e9 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Mon, 1 Jan 2018 20:07:54 +0100 Subject: fixed rho --- math/primes.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/math/primes.cpp b/math/primes.cpp index bbc63d9..79e0001 100644 --- a/math/primes.cpp +++ b/math/primes.cpp @@ -21,6 +21,7 @@ ll rho(ll n) { // Findet Faktor < n, nicht unbedingt prim. while (d == 1) { x = ((x * x) % n + c) % n; y = ((y * y) % n + c) % n; + y = ((y * y) % n + c) % n; d = gcd(abs(x - y), n); // Implementierung von oben. } return d == n ? rho(n) : d; -- cgit v1.2.3