問題一覧 > 通常問題

No.203 Golden Week (1)

レベル : / AI推定難易度 : 118 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 726
作問者 : yuki2006
お気に入りにしたユーザー ProblemId : 526 / 自分の提出
問題文最終更新日: 2026-06-26 16:47:46
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 103 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。