Commit 86bae20c authored by 24OI-bot's avatar 24OI-bot
Browse files

style: format markdown files with remark-lint

parent a117b82f
Loading
Loading
Loading
Loading
+103 −98
Original line number Diff line number Diff line
@@ -175,12 +175,11 @@ border:若 $0 \le r < |s|$,$pre(s,r)=suf(s,r)$,就称 $pre(s,r)$ 是 $s$

引理 $1$ : $t$ 是回文串 $s$ 的后缀, $t$ 是 $s$ 的 border 当且仅当 $t$ 是回文串。

> 证明:
> 证明
>
> 对于 $1 \le i \le |t|$ ,由 $s$ 和 $t$ 为回文串,因此有 $s[i]=s[|s|-i+1]=s[|s|-|t|+i]$ ,所以 $t$ 是 $s$ 的 border。
>
> 对于 $1 \le i \le |t|$ ,由 $t$ 是 $s$ 的 border,有 $s[i]=s[|s|-|t|+i]$ ,由 $s$ 是回文串,有 $s[i]=s[|s|-i+1]$ ,因此 $s[|s|-i+1]=s[|s|-|t|+i]$ ,所以 $t$ 是回文串。
>

下图中,相同颜色的位置表示字符对应相同。

@@ -275,9 +274,11 @@ namespace pam {
  return sz;
}
void clear() {
        sz = -1; last = 0;
  sz = -1;
  last = 0;
  s[tot = 0] = '$';
        node(0); node(-1);
  node(0);
  node(-1);
  fail[0] = 1;
}
int getfail(int x) {
@@ -294,19 +295,22 @@ namespace pam {
    ch[now][c - 'a'] = x;

    dif[x] = len[x] - len[fail[x]];
            if (dif[x] == dif[fail[x]]) slink[x] = slink[fail[x]];
            else slink[x] = fail[x];
    if (dif[x] == dif[fail[x]])
      slink[x] = slink[fail[x]];
    else
      slink[x] = fail[x];
  }
  last = ch[now][c - 'a'];
  cnt[last]++;
}
}
using pam::len;
}  // namespace pam
using pam::dif;
using pam::fail;
using pam::len;
using pam::slink;
using pam::dif;

int n, dp[maxn], g[maxn]; char s[maxn], t[maxn];
int n, dp[maxn], g[maxn];
char s[maxn], t[maxn];

int main() {
  pam::clear();
@@ -347,10 +351,11 @@ int main() {

-   2017 年 IOI 国家候选队论文集 回文树及其应用 翁文涛

+ 2019 年 IOI 国家候选队论文集 子串周期查询问题的相关算法及其应用 陈孙立

+ 字符串算法选讲 金策
-   2019 年 IOI 国家候选队论文集 子串周期查询问题的相关算法及其应用 陈孙立

-   字符串算法选讲 金策

+ [A bit more about palindromes](https://codeforces.com/blog/entry/19193)
-    [A bit more about palindromes](https://codeforces.com/blog/entry/19193) 

+ [A Subquadratic Algorithm for Minimum Palindromic Factorization](https://arxiv.org/pdf/1403.2431.pdf)
-    [A Subquadratic Algorithm for Minimum Palindromic Factorization](https://arxiv.org/pdf/1403.2431.pdf)