Skip to content

Commit

Permalink
lg
Browse files Browse the repository at this point in the history
  • Loading branch information
maspypy committed Sep 12, 2024
1 parent 87b666b commit 7af546a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion number_theory/two_square_sum/sol/correct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }

template <typename T>
T floor(T a, T b) {
Expand Down Expand Up @@ -186,7 +188,7 @@ ll rho(ll n, ll c) {
auto f = [&](mint x) { return x * x + cc; };
mint x = 1, y = 2, z = 1, q = 1;
ll g = 1;
const ll m = 1LL << (__lg(n) / 5);
const ll m = 1LL << (topbit(n) / 5);
for (ll r = 1; g == 1; r <<= 1) {
x = y;
FOR(r) y = f(y);
Expand Down

0 comments on commit 7af546a

Please sign in to comment.