#P2646. 数数zzy
数数zzy
Description
After failing math exams consecutively, zzy stopped paying attention in math class (in fact, he never really did). He starts doodling on scratch paper, for example writing a strange string. Then he decides to have some fun rationally: count how many subsequences equal to zzy appear in this string. Note that it is subsequences rather than substrings. But the string is so long that he cannot possibly count them. So he asks you for help. Can you help him?
Input Format
One line containing a string consisting of lowercase letters.
Output Format
One line with a non-negative integer: the number of subsequences equal to zzy in the input string.
zlzhy
1
Hint
Constraints
Let denote the length of string .
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that , and the answer does not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号