标签:res 之间 mes element 相同 区间 统计 order form
题目链接:【http://codeforces.com/contest/1003/problem/F】
题意:给出一个n字符串,这些字符串按顺序组成一个文本,字符串之间用空格隔开,文本的大小是字母+空格的个数。在这个文本中找k(k>=2)个区间,使得这k个区间完全相同,字符串不能分开,然后把每段的字符串变成单个的字符,并去掉中间的空格。可能有多种方案,求文本的最小长度。【表达能力有限,望理解,具体可以看题目】
You are given a text consisting of nn space-separated words. There is exactly one space character between any pair of adjacent words. There are no spaces before the first word and no spaces after the last word. The length of text is the number of letters and spaces in it. wiwi is the ii-th word of text. All words consist only of lowercase Latin letters.
Let‘s denote a segment of words w[i..j]w[i..j] as a sequence of words wi,wi+1,…,wjwi,wi+1,…,wj. Two segments of words w[i1..j1]w[i1..j1] and w[i2..j2]w[i2..j2] are considered equal if j1?i1=j2?i2j1?i1=j2?i2, j1≥i1j1≥i1, j2≥i2j2≥i2, and for every t∈[0,j1?i1]t∈[0,j1?i1] wi1+t=