問題一覧 > 通常問題

No.2298 yukicounter

レベル : / AI推定難易度 : 167 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 177
作問者 : Shirotsume / テスター : 👑 p-adic ygussany
お気に入りにしたユーザー ProblemId : 9288 / 自分の提出
問題文最終更新日: 2023-05-03 01:06:47
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 388 (順位表) の他の問題:

Problem Statement

You are given a string $S$ consisting of lowercase English letters. Find the maximum number of times the string yukicoder appears consecutively in $S$.

More precisely, find the maximum non-negative integer $K$ satisfying the following condition.

  • Let $T$ be the string obtained by repeating the string yukicoder $K$ times. Then $T$ is a contiguous substring of $S$.

Constraints

  • $S$ is a string consisting of lowercase English letters with length at least $9$ and at most $10^6$.

Input

The input is given from Standard Input in the following format.

$S$

Output

Print the answer.

Sample

Sample 1
Input
yukicoderaayukicoderyukicoder
Output
2

As shown by yukicoder aa yukicoderyukicoder, $S$ has a part where yukicoder appears $1$ time consecutively and a part where it appears $2$ times consecutively.

Of these, print the larger value, $2$. Note that the occurrences must be consecutive.

Sample 2
Input
codeforces
Output
0

The string obtained by repeating yukicoder $0$ times is the empty string, and the empty string is a substring of $S = $ codeforces.

Sample 3
Input
yukicoderyukicoderyukicoderyukicoderyukiyukicoderyukicoderyukicoder
Output
4

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。