Replies: 35 comments 4 replies
-
写得好好啊qwq |
Beta Was this translation helpful? Give feedback.
-
想知道在多个字符串间的最长公共子串中的算法的时间复杂度是$k\sum S_i$的吗? |
Beta Was this translation helpful? Give feedback.
-
@PhoenixGS 是呀 |
Beta Was this translation helpful? Give feedback.
-
写的很好啊!!! |
Beta Was this translation helpful? Give feedback.
-
不考虑加一点广义SAM相关的内容吗qwq |
Beta Was this translation helpful? Give feedback.
-
@ajcxsu 好耶 欢迎来加 |
Beta Was this translation helpful? Give feedback.
-
引理 1: 两个非空子串 和 (假设 )的 相同,当且仅当字符串 是 的后缀。 |
Beta Was this translation helpful? Give feedback.
-
算法中的最后一项:
此处翻译有误,英文翻译的原文为:
或应翻译成:
|
Beta Was this translation helpful? Give feedback.
-
试着开个 pr qwq |
Beta Was this translation helpful? Give feedback.
-
@longlongzhu123 好耶!麻烦帮忙开个 pr 修一下呗 👍 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
第一次出现的位置中: |
Beta Was this translation helpful? Give feedback.
-
你在分裂节点的时候需要把原节点的连边复制一遍,暴力for或者memcpy都是O(|Σ|)的 |
Beta Was this translation helpful? Give feedback.
-
算法的描述有点问题。 |
Beta Was this translation helpful? Give feedback.
-
求出现次数还可以将 last 到根路径上的结点设为出现1次,然后在 SAM 上拓扑 |
Beta Was this translation helpful? Give feedback.
-
写的很好啊!!! |
Beta Was this translation helpful? Give feedback.
-
不用平衡树的 SAM 应该是 |
Beta Was this translation helpful? Give feedback.
-
引理2那里不应该是子集吗?为啥是真子集?也会有相等的情况呀? |
Beta Was this translation helpful? Give feedback.
-
longest 的定义是啥??? |
Beta Was this translation helpful? Give feedback.
-
请问 Wikipedia 上面有没有 SAM 的页面,检索失败 |
Beta Was this translation helpful? Give feedback.
-
应用 -> 出现次数。 “我们只需要考虑两个可能有相同 \operatorname{endpos} 值的不同状态。如果一个状态是由另一个复制而来的,则这种情况会发生。然而,这并不会对复杂度分析造成影响,因为每个状态至多被复制一次。” 这句话是错误的,不一定每一个状态只被复制一次。例如 aabbab。 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
对于 多个字符串间的最长公共子串 直接按照 两个字符串的最长公共子串 就好了吧。 把一个串拿去匹配,剩下的串各自建立 SAM,每次的匹配长度就是剩下的串各自匹配长度的 |
Beta Was this translation helpful? Give feedback.
-
最后一个应用(多个字符串间最长公共子串)答案我感觉不太优,个人认为让剩下字符串去和第一个字符串的后缀自动机匹配更好(详见https://www.cnblogs.com/Jiaaaaaaaqi/p/10903614.html) ,这样空间上不用*k(字符串个数),时间上也更快。通过上面提到的方法和我提到的方法进行对比,在1e5数据量的时候,二者时间差>=10倍。 |
Beta Was this translation helpful? Give feedback.
-
后缀自动机的转移边的数量少于3n-4,那是否可以只开辟3n的空间来维护所有的转移边呢?为每个状态都用一个std::map来维护转移边的开销太大了。 |
Beta Was this translation helpful? Give feedback.
-
https://oi-wiki.org/string/sam/
Beta Was this translation helpful? Give feedback.
All reactions