快速幂
约 38 字小于 1 分钟
2025-03-12
auto pow = [](int x, int y) {
int ans = 1;
while (y) {
if (y & 1) ans *= x;
y >>= 1;
x *= x;
}
return ans;
};约 38 字小于 1 分钟
2025-03-12
auto pow = [](int x, int y) {
int ans = 1;
while (y) {
if (y & 1) ans *= x;
y >>= 1;
x *= x;
}
return ans;
};