atcoder#ABC229D. [ABC229D] Longest X
[ABC229D] Longest X
Score : points
Problem Statement
Given is a string consisting of X
and .
.
You can do the following operation on between and times (inclusive).
- Replace a
.
with anX
.
What is the maximum possible number of consecutive X
s in after the operations?
Constraints
- Each character of is
X
or.
. - is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
XX...X.X.X.
2
5
After replacing the X
s at the -th and -th positions with X
, we have XX...XXXXX.
, which has five consecutive X
s at -th through -th positions.
We cannot have six or more consecutive X
s, so the answer is .
XXXX
200000
4
It is allowed to do zero operations.