• 300iq contest1 K.Knowledge


    复制标题的时候才发现这一场题目首字母和编号相同诶

    题目链接

    Description

    给出一个字符串 (s),每次可以在任意位置增删aabbbababab,问能形成多少种不同的长度为 (L) 的串。

    Solution

    又是手建自动机的神仙题!

    这个操作显然是可逆的,故考虑把每个串表示成等价的最短的串。

    手玩一下,发现只有 (12) 种本质不同的最短的串。

    然后手玩一下这些转移,只有 (24) 种很快就出来了。

    [egin{align*} emptysetstackrel a{longrightarrow}a & & emptysetstackrel b{longrightarrow}b \ astackrel a{longrightarrow}emptyset & & astackrel b{longrightarrow}ab \ bstackrel a{longrightarrow}ba & & bstackrel b{longrightarrow}bb \ abstackrel a{longrightarrow}aba & & abstackrel b{longrightarrow}abb \ bastackrel a{longrightarrow}b & & bastackrel b{longrightarrow}bab \ bbstackrel a{longrightarrow}bba & & bbstackrel b{longrightarrow}emptyset \ abastackrel a{longrightarrow}ab & & abastackrel b{longrightarrow}bba \ abbstackrel a{longrightarrow}bab & & abbstackrel b{longrightarrow}a \ babstackrel a{longrightarrow}abb & & babstackrel b{longrightarrow}babb \ bbastackrel a{longrightarrow}bb & & bbastackrel b{longrightarrow}bbab \ babbstackrel a{longrightarrow}bbab & & babbstackrel b{longrightarrow}ba \ bbabstackrel a{longrightarrow}babb & & bbabstackrel b{longrightarrow}aba \ end{align*} ]

    弄出这个以后转移用矩阵加速就可以了。

    SV:你看这只是一个正四面体的旋转群((12) 阶),下次我出一个正二十面体的旋转群((60) 阶)看你怎么手模(毒瘤!)。

  • 相关阅读:
    你像一道阳光,照进我的心里
    why
    存储过程 或视图的字符串查询
    C# DataGridView 导出Excle代码和总结(转)
    年夜饭
    登陆SQL Server 2008时提示评估期已过的解决办法
    斐波那契可以考虑的地方?
    解决 UPDATEPANEL 内 ScriptManager1.SetFocus 设置焦点 输入法 变更的问题
    跨域 iframe 读写 cookie的 那点事
    javascript 节点操作
  • 原文地址:https://www.cnblogs.com/realSpongeBob/p/300iq-Contest1-K.html
Copyright © 2020-2023  润新知