字符串-后缀数组
brav0
练习算法两年半的ACM选手
展开
-
2020牛客暑期多校训练营(第一场)A B-Suffix Array(后缀数组,思维)
链接:https://ac.nowcoder.com/acm/contest/5666/A 来源:牛客网 题目描述 The BBB-function B(t1t2…tk)=b1b2…bkB(t_1 t_2 \dots t_k) = b_1 b_2 \dots b_kB(t1t2…tk)=b1b2…bk of a string t1t2…tkt_1 t_2 \dots t_kt1t2…tk is defined as follows. If there is an index j&.原创 2020-07-13 00:16:25 · 489 阅读 · 0 评论 -
POJ 1743 Musical Theme(后缀数组)
A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representat...原创 2019-09-25 00:17:47 · 144 阅读 · 0 评论 -
POJ-3261 Milk Patterns(后缀数组)
Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk from one day to th...原创 2019-09-25 00:20:47 · 124 阅读 · 0 评论 -
SPOJ - DISUBSTR Distinct Substrings(后缀数组)
Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 Output For e...原创 2019-09-25 00:25:17 · 155 阅读 · 0 评论 -
SPOJ - SUBST1 New Distinct Substrings(后缀数组)
Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20; Each test case consists of one string, whose length is <= 50000 Output For ...原创 2019-09-25 00:27:28 · 137 阅读 · 0 评论 -
POJ - 2406 Power Strings(DC3算法)
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-...原创 2019-09-25 00:37:20 · 267 阅读 · 0 评论 -
POJ - 3294 Life Forms(后缀数组)
You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, eyebrows and the like. A few bear no human resemblan...原创 2019-09-25 18:59:37 · 405 阅读 · 0 评论 -
后缀自动机求两个串的最长公共子串
假设有两个串分别为S, T 求他们的最长公共子串 我们先对S建立后缀自动机, 然后从S的起点u开始, 再记一个长度L, 添加T[1 ~ LenT] 若存在子节点意味着添加当前字符后, 我们可以得到下一个状态,此时令状态u = next[u][c], L++. 若不存在, 即不断跳lnk[u],直到有状态v满足next[v][c] != 0, 令u = next[v][c], L = le...原创 2019-10-07 01:18:01 · 597 阅读 · 0 评论