CF452E.Three strings

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given three strings (s1,s2,s3)(s_{1},s_{2},s_{3}) . For each integer ll (1<=l<=min(s1,s2,s3)(1<=l<=min(|s_{1}|,|s_{2}|,|s_{3}|) you need to find how many triples ( i1,i2,i3i_{1},i_{2},i_{3} ) exist such that three strings sk[ik... ik+l1]s_{k}[i_{k}...\ i_{k}+l-1] (k=1,2,3)(k=1,2,3) are pairwise equal. Print all found numbers modulo 1000000007 (109+7)1000000007 (10^{9}+7) .

See notes if you are not sure about some of the denotions used in the statement.

输入格式

First three lines contain three non-empty input strings. The sum of lengths of all strings is no more than 31053·10^{5} . All strings consist only of lowercase English letters.

输出格式

You need to output min(s1,s2,s3)min(|s_{1}|,|s_{2}|,|s_{3}|) numbers separated by spaces — answers for the problem modulo 1000000007 (109+7)1000000007 (10^{9}+7) .

输入输出样例

  • 输入#1

    abc
    bc
    cbc
    

    输出#1

    3 1 
    
  • 输入#2

    abacaba
    abac
    abcd
    

    输出#2

    11 2 0 0 
    

说明/提示

Consider a string t=t1t2... ttt=t_{1}t_{2}...\ t_{|t|} , where tit_{i} denotes the ii -th character of the string, and t|t| denotes the length of the string.

Then t[i... j]t[i...\ j] (1<=i<=j<=t)(1<=i<=j<=|t|) represents the string titi+1... tjt_{i}t_{i+1}...\ t_{j} (substring of tt from position ii to position jj inclusive).

首页