Stringology
면접 대비시간 제한1초메모리 제한1024 MB
s의 각 접두사에 t를 이어 붙인 문자열에 대해, s의 진접두사이면서 그 접미사인 가장 긴 길이를 모두 구한다.
문제
For a string , Bobo denotes the prefix by . Similarly, he denotes the suffix by . In particular, and are empty strings.
For two strings and , Bobo denotes the concatenation by . Also,
Given two strings and , let . Find the value of .
입력
The input consists of several test cases terminated by end-of-file. For each test case,
The first line contains a string .
The second line contains a string .
출력
For each test case, output integers which denote .
제한
- for each
- for each
- In each input, the sum of .
힌트
For the second case, ababaababaababaababa.
Therefore, .