📄 modfunc.cpp
字号:
#include "ap.h"
// Overloaded modint power
// Uses standard O(log exp) scheme
// For extreme portability this quite slow, so avoid whenever possible
modint pow (modint base, rawtype exp)
{
modint r;
if (exp == 0) return 1;
while (!bigshr (&exp, &exp, 1))
base *= base;
r = base;
while (exp > 0)
{
base *= base;
if (bigshr (&exp, &exp, 1)) r *= base;
}
return r;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -