题意:对N个由(,)组成的字符串,求拼接后得到的最大的balance序列的长度。balance序列:空串/ A+B(A,B都是b序列)/ (+A+),A为b序列。此三种情况。 分析:在读入N每个字符串时,先将单独一个字符串中的b序列长度提取出来,记录其没有被使用的左弧L和右弧R的数目。因为要使其最后 ...
分类:
其他好文 时间:
2018-07-24 17:57:46
阅读次数:
131
Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have ...
分类:
其他好文 时间:
2018-07-24 17:44:36
阅读次数:
218
1002: Balanced Sequence 题意:给定n个字符串,n的大小在1e5左右,字符串的长度也是1e5,字符串仅由‘(’或‘)’组成,合法串可以不是连续的,将这n个串按照一定的顺序排列起来,使得组合之后的字符串的合法串的长度最长。n*len的大小是1e6 思路:首先n*len的处理出来每 ...
分类:
其他好文 时间:
2018-07-23 23:38:46
阅读次数:
317
来怒做GSS系列了; GSS1:https://www.luogu.org/problemnew/show/SP1043 这题就是维护一个 sum , mx , lmx , rmx,转移时用结构体就好了。 代码如下: GSS2:https://www.luogu.org/problemnew/sho ...
分类:
其他好文 时间:
2018-07-22 11:27:11
阅读次数:
133
A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box wi ...
分类:
其他好文 时间:
2018-07-21 14:56:30
阅读次数:
122
D-query Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), ...
分类:
其他好文 时间:
2018-07-21 14:54:14
阅读次数:
159
D - New Distinct Substrings 题目大意:求一个字符串中不同子串的个数。 裸的后缀数组 ...
分类:
其他好文 时间:
2018-07-20 22:27:43
阅读次数:
139
LCS2 - Longest Common Substring II 链接 题意: 求N(N<=10)个串的最长公共子串。 分析: poj2774上那道题,对一个串建立后缀自动机,另一个在上面匹配。 这道题是对多个串求。那么同样,让每个串在后缀自动机上匹配,然后记录在后缀自动机的每个节点上记录,当前 ...
分类:
其他好文 时间:
2018-07-19 16:19:25
阅读次数:
129
Thanks a lot for helping Harry Potter in finding the Sorcerer's Stone of Immortality in October. Did we not tell you that it was just an online game ? ...
分类:
其他好文 时间:
2018-07-13 16:17:03
阅读次数:
173