Duplicated Binary Strings
시간 제한1초메모리 제한2048 MB
이진 문자열 S가 주어질 때, 길이가 짝수이고 앞뒤 절반이 같은 서로 다른 부분 문자열의 개수를 센다.
문제
Carlos spends his summer holiday studying duplicated binary strings. A duplicated binary string is a non-empty string such that:
- contains only the characters
0and1(that is, is a binary string). - can be written in the form , where is an arbitrary binary string and the operation denotes the concatenation of the strings and (i.e., writing them one after the other as a single string).
For example, 0000 and 011011 are duplicated binary strings, but 01, 0110, and 000 are not.
Define the strength of a binary string as the number of distinct contiguous duplicated substrings present in . Two substrings are considered different if they differ in at least one character.
This problem consists of two parts, with each subtask associated with either Part I or Part II. You may solve the subtasks in any order; in particular, you are not required to complete all of Part I before attempting Part II.
예제
이 문제는 공개된 예제가 없습니다.