No.341 Period of Silence
タグ : / 解いたユーザー数 375
作問者 :
butchi_y
Problem Statement
Given a string, output the length of the longest consecutive run of the character "…".
Hint: "…" is not 3 characters.
Beginners are not recommended to solve this in C/C++ (languages in which UTF-8 is hard to handle).
Input
S
A UTF-8 string (without BOM, consisting of printable characters other than newlines) is given as $S$.
The length of the UTF-8 string is at least 1 character and at most 100 characters.
Output
Output the number of "…" in the longest consecutive run. If "…" never appears, output 0. Print a newline at the end.
Sample
Sample 1
Input
……何でもないです。
Output
2
"……" is the longest consecutive run, so the number of "…" in it is 2.
Sample 2
Input
………別に………
Output
3
"………" appears in 2 places, and the number of "…" in either one of them is 3.
Sample 3
Input
……………
Output
5
The number of "…" in "……………" is 5.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。