妙用next数组打表求最小循环节len
2021-07-11 12:06
阅读:771
标签:循环 pow a* res name for char == printf
#include
#include
#include
#include
using namespace std;
int len;
int n = 1000;
int next[10000];
int f[50000];
char s[50000];
int Pow(int a, int b)
{
int res=1;
while(b)
{
if(b&1)
res=res*a%7;
a=a*a%7;
b>>=1;
}
return res;
}
void getnext()
{
int j=0,k=-1;
next[0]=-1;
while(j1) //周期大于1才是循环串
{
cout
妙用next数组打表求最小循环节len
标签:循环 pow a* res name for char == printf
原文地址:https://www.cnblogs.com/Roni-i/p/9551463.html
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:妙用next数组打表求最小循环节len
文章链接:http://soscw.com/index.php/essay/103696.html
文章标题:妙用next数组打表求最小循环节len
文章链接:http://soscw.com/index.php/essay/103696.html
评论
亲,登录后才可以留言!