Skip to content

Commit

Permalink
Fix euler_phi
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Aug 5, 2024
1 parent f3fc883 commit f91796a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cp-algo/math/number_theory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace cp_algo::math {

int64_t euler_phi(int64_t m) {
auto primes = factorize(m);
std::ranges::sort(primes);
auto [from, to] = std::ranges::unique(primes);
primes.erase(from, to);
int64_t ans = m;
Expand Down

0 comments on commit f91796a

Please sign in to comment.