标签:amp oid 关于 DPoS ++ eof mem 节点 size
关于 SAM:
int kid[T][A], len[T], lnk[T];
int lst = 1, ct = 1;
void insert(int c) {
int p = lst, np = ++ct;
len[np] = len[p] + 1, siz[np] = 1, lst = np;
for (; p && !kid[p][c]; p = lnk[p]) kid[p][c] = np;
if (!p) lnk[np] = 1;
else {
if (len[p] + 1 == len[kid[p][c]]) lnk[np] = kid[p][c];
else {
int q = kid[p][c], nq = ++ct;
len[nq] = len[p] + 1, lnk[nq] = lnk[q], lnk[q] = lnk[np] = nq;
memcpy(kid[nq], kid[q], sizeof(kid[q]));
for (; p && kid[p][c] == q; p = lnk[p]) kid[p][c] = nq;
}
}
}
标签:amp oid 关于 DPoS ++ eof mem 节点 size
原文地址:https://www.cnblogs.com/Ryedii-blog/p/12400566.html