Commit 8bb190a2 authored by 24OI-bot's avatar 24OI-bot
Browse files

style: format markdown files with remark-lint

parent fc41b8d9
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@
    using namespace std;
    typedef long long ll;
    const int maxn = 300000 + 5;
    ```

    namespace pam {
    int sz, tot, last;
@@ -250,7 +251,6 @@ border:若 $0 \le r < |s|$ , $pre(s,r)=suf(s,r)$ ,就称 $pre(s,r)$ 是 $s

给定一个字符串 $s$ ,要求将 $s$ 划分为 $t_1, t_2, \dots, t_k$ ,其中 $k$ 是偶数,且 $t_i=t_{k-i}$ ,求这样的划分方案数。


??? note "题解"
    构造字符串 $t= s[0]s[n - 1]s[1]s[n - 2]s[2]s[n - 3] \dots s[n / 2 - 1]s[n / 2]$ ,问题等价于求 $t$ 的偶回文划分方案数,把上面的转移方程改成求和形式并且只在偶数位置更新 $dp$ 数组即可。时间复杂度 $O(n \log n)$ ,空间复杂度 $O(n)$ 。

@@ -261,6 +261,7 @@ border:若 $0 \le r < |s|$ , $pre(s,r)=suf(s,r)$ ,就称 $pre(s,r)$ 是 $s
    typedef long long ll;
    const int mod = 1e9 + 7;
    const int maxn = 1000000 + 5;
    ```

    inline int add(int x, int y) {
      x += y;