diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2022-11-30 12:43:27 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2022-11-30 12:43:27 +0100 |
| commit | 03788f48be2634c36cd19ba25b0a851685b9c877 (patch) | |
| tree | ef430668558366afe95d958d26250361f5452666 /math | |
| parent | 99259d60cb345eae15211397f3199aa86ac2bceb (diff) | |
use all macro
Diffstat (limited to 'math')
| -rw-r--r-- | math/chineseRemainder.cpp | 3 | ||||
| -rw-r--r-- | math/piLegendre.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/math/chineseRemainder.cpp b/math/chineseRemainder.cpp index 2308836..86a10ae 100644 --- a/math/chineseRemainder.cpp +++ b/math/chineseRemainder.cpp @@ -26,8 +26,7 @@ struct ChineseRemainder { // Löst das System. ll solve() { - M = accumulate(mods.begin(), mods.end(), lll(1), - multiplies<lll>()); + M = accumulate(all(mods), lll(1), multiplies<lll>()); inv.resize(sz(lhs)); for (int i = 0; i < sz(lhs); i++) { lll x = (M / mods[i]) % mods[i]; diff --git a/math/piLegendre.cpp b/math/piLegendre.cpp index f45ee85..21b974b 100644 --- a/math/piLegendre.cpp +++ b/math/piLegendre.cpp @@ -16,7 +16,7 @@ ll phi(ll n, ll k) { ll pi(ll n) {
if (n < N) { // implement this as O(1) lookup for speedup!
- return distance(primes.begin(), upper_bound(primes.begin(), primes.end(), n));
+ return distance(primes.begin(), upper_bound(all(primes), n));
} else {
ll k = pi(sqrtl(n) + 1);
return n - phi(n, k) + k;
|
