diff options
| author | mzuenni <mzuenni@users.noreply.github.com> | 2018-01-01 20:07:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-01 20:07:54 +0100 |
| commit | cef5b16480b1a2009fab7cad1b4d92974fc911e9 (patch) | |
| tree | dbe1132281434ce13488e159feb9bace6deb2de5 | |
| parent | dc1014bf6441d8bd61d4257fc481394736491da7 (diff) | |
fixed rho
| -rw-r--r-- | math/primes.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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; |
