Logo
(追記) (追記ここまで)

21166번 - Substring Characters 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB53402980.556%

문제

The set of distinct characters in a string is referred to as the generalized period of the string. As an example, the generalized period of the string "aabbabb" is {'a','b'}

A proper substring is a contiguous substring that is contained in a string and is not the string itself. So "aabbabb" is not a proper substring of the above example.

A minimal proper substring is one that can have no character removed from either end and still have the same generalized period. "aabb" is a proper substring of the example, but it is not minimal. "ab" is minimal.

Unique means that multiple occurrences of the same minimal proper substring in a string are only to be counted once. In the example, "ab" appears twice, but is counted once---hence the number of proper minimal unique substrings with the same generalized period of the entire string is two: "ab" and "ba".

Your team is to write a program to count the number of proper minimal unique substrings of a given string that have the same generalized period as the string itself.

입력

Input to your program is a series of lines terminated by end-of-file. Each line is a test case consisting of alphanumeric characters (a--z, A--Z, 0--9). Upper-case and lower-case letters are distinct. The new line character is not part of the test case string. No test case string will exceed 80ドル$ characters. There will be at most 100ドル$ test strings in input.

출력

For each input line print a line containing the number of proper minimal unique substrings of the input string with no leading or trailing whitespace and no extra leading signs or zeros.

제한

예제 입력 1

aabbabb
abAB34aB3ba7
104001144
aaabcaaa
a
bb
bd
1234567

예제 출력 1

2
1
3
2
0
1
0
0

힌트

출처

ICPC > Regionals > North America > North Central North America Regional > NCNA 2020 D번

ICPC > Regionals > North America > Southern California Regional > 2020 Southern California Regional 8번

  • 문제를 만든 사람: Bob Logan
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /