logo AlgoBeat OnlineJudge
登录 注册

#216407. [SYSUCPC 2025] SYSU II

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

As you all know, you are participating in the SYSUCPC (SYSU Counting Periodic-string Contest) finals.

A string is considered if and only if it can be rearranged into a perfectly periodic string with as its period (which means several repetitions). For example, are all , while are not. Given a string , determine how many of its substrings are .

A string is a substring of a string if can be obtained from by the deletion of several (possibly zero or all) characters from the beginning and several (possibly zero or all) characters from the end.

输入格式

The only line contains a single string . It is guaranteed that only contains lowercase English letters.

输出格式

An integer, representing the number of substrings of .

样例

样例输入 1

ilovesysusysu

样例输出 1

6

数据范围与提示

There are substrings : .