#P9078. [PA 2018] Język polski
[PA 2018] Język polski
Problem Description
This problem is translated from PA 2018 Round 1 Język polski.
Given a string , find the number of substrings that satisfy the following condition.
- In this substring, there exists at least one length substring consisting only of consonant letters or only of vowel letters.
Note that Polish vowels are different from English. In Polish, the vowels are .
Any letter that is not a vowel is a consonant.
Input Format
One line containing a string consisting only of lowercase letters.
Output Format
Output one integer in one line, representing the number of substrings that satisfy the condition.
kostka
6
aaaa
3
Hint
Explanation for Sample 1
All substrings that satisfy the condition are as follows: $\texttt{stk},\texttt{ostk},\texttt{kostk},\texttt{stka},\texttt{ostka},\texttt{kostka}$.
Constraints
This problem uses bundled testdata.
Let the string length be , then .
Translated by ChatGPT 5