
后缀自动机
nike0good
这个作者很懒,什么都没留下…
展开
-
SPOJ NSUBSTR(Substrings-后缀自动机统计串出现次数-Right集合&Parent树の暴走)
8222. Substrings Problem code: NSUBSTR You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some stri原创 2013-08-21 23:22:15 · 4324 阅读 · 0 评论 -
SPOJ LCS2(Longest Common Substring II-后缀自动机向父亲更新)
1812. Longest Common Substring II Problem code: LCS2 A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters.原创 2013-08-23 20:16:57 · 1581 阅读 · 0 评论 -
SPOJ LCS(Longest Common Substring-后缀自动机-结点的Parent包含关系)
1811. Longest Common Substring Problem code: LCS A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Su原创 2013-08-23 17:26:34 · 1598 阅读 · 0 评论 -
HDU 5343(MZL's Circle Zhou-SAM)[Template:SAM]
MZL's Circle Zhou Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 236 Accepted Submission(s): 80 Problem Description MZL's Circle原创 2015-08-23 19:27:04 · 1340 阅读 · 0 评论 -
西安十五日游 day13 练习 【后缀自动机】
Lexicographical Substring Search Glass Beads str2int AB String New Distinct Substrings Boring countingLexicographical Substring Search给一个字符串,求第k大子串,经典题#include<cstdio> #include<cstring> #include<cstdli原创 2016-08-14 23:44:10 · 1079 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online
A string string string判断一个字符串恰出现k次的子串个数。 建立SAM,对每个节点统计出现次数cnticnt_i,先对字符串的n个后缀的cnti+=1cnt_i+=1,然后将每个节点的值更新父节点。#include<bits/stdc++.h> using namespace std; #define For(i,n) for(int i=1;i<=n;i++) #defi原创 2017-09-11 01:18:13 · 871 阅读 · 1 评论 -
是男人就过 8 题--Pony.AI 题(A String Game-SAM建图+sg)
给一个字符串t和t的n个子串,2人轮流操作, 每次选一个子串,在后面添加一个字符,放回去,要求添加后字符串仍是t的子串。 无法操作者输,问谁赢。SAM建图+sg#include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<functional> #include<iostream> #inclu原创 2018-03-28 22:53:30 · 1346 阅读 · 0 评论