Skip to content

Commit f91796a

Browse files
committed
Fix euler_phi
1 parent f3fc883 commit f91796a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cp-algo/math/number_theory.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace cp_algo::math {
1212

1313
int64_t euler_phi(int64_t m) {
1414
auto primes = factorize(m);
15+
std::ranges::sort(primes);
1516
auto [from, to] = std::ranges::unique(primes);
1617
primes.erase(from, to);
1718
int64_t ans = m;

0 commit comments

Comments
 (0)