No.203 Golden Week (1)
タグ : / 解いたユーザー数 726
作問者 :
Problem Statement
Apparently it is Golden Week out there.
So here is a Golden Week-themed problem.
You are given a calendar showing weekdays ($x$) and holidays ($o$) for a period of $2$ weeks.
All days outside this $2$-week period are considered weekdays.
Find the maximum number of consecutive holidays (the length of the longest run of consecutive days off).
Input
$C_{1}C_{2}....C_{7}$
$C_{8}C_{9}....C_{14}$
Each $C_{i}$ is the character $"x"$ or $"o"$. $"x"$ represents a weekday and $"o"$ represents a holiday.
$C_{1},C_{2}...,C_{N}$ represent consecutive days.
Output
Find the maximum number of consecutive holidays (the length of the longest run of consecutive days off).
Sample
Sample 1
Input
oxxoxxo ooooxxo
Output
5
This is the Golden Week of 2015.
Sample 2
Input
ooxxxxx ooooooo
Output
7
Sample 3
Input
oxxxxxo oxxxxxo
Output
2
Note that the end of the first line and the beginning of the second line are connected.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。