#P1321. 单词覆盖还原
单词覆盖还原
Description
I have a string of length , which initially consists of periods ('.').
I repeatedly paste the words boy or girl onto this string in order.
Words pasted later will overwrite previously pasted words or periods. In the end, each word has at least one character that is not overwritten.
How many boy and how many girl were pasted in total?
Input Format
A single line: the string after repeatedly pasting the words boy and girl.
Output Format
Two lines, each with one integer. The first line is the count of boy, and the second line is the count of girl.
......boyogirlyy......girl.......
4
2
Hint
It is guaranteed that , and the string contains only the following characters: .
Translated by ChatGPT 5
京公网安备 11011102002149号