問題一覧 > 通常問題

No.342 What Made Me LOL the Mostww

レベル : / AI推定難易度 : 525 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 132
作問者 : butchi_y
お気に入りにしたユーザー ProblemId : 564 / 自分の提出
問題文最終更新日: 2026-10-16 19:50:20
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 131 (順位表) の他の問題:

Note

Since this problem handles UTF8 strings, it may be difficult to solve in some languages.

Problem Statement

Alice: "So just noww I was rereading the stuff I wrotew and I got curious about what cracked me up the mostw so I tried writing a programwww"

Bob: "Thatww I'm super curiousw"

Carol: "I am curious as well."

Output the sentence immediately before the longest run of consecutive "w" (note that this is a full-width character).
However, a run of "w" at the beginning of the line is not counted as such a location.

The sentence ends at the character immediately before the longest run of "w".
It starts where, counting from the end of the sentence toward the beginning, the next "w" is about to be reached, or at the beginning of the line if no "w" appears.
If there are two or more longest runs of "w", separate the sentences with newlines. (Output them in order of appearance.)
If "w" never appears, or if all characters are "w", output an empty string.

Input

S

A UTF-8 string (without BOM, consisting of printable characters other than newlines) is given as $S$.
Note that the input may contain ASCII spaces.
The length of the UTF-8 string is at least 1 character and at most 100 characters.

Output

Output the UTF8 string (without BOM) that satisfies the problem statement.
(You normally should not need to worry about this, but if a BOM is attached, the verdict will be WA.)
Print a newline at the end.

Sample

Sample 1
Input
海賊王にw俺はなるww
Output
俺はなる

The run of 2 "w" is the longest, so output the sentence before it.

Sample 2
Input
うはwwwwwおkwwwww
Output
うは
おk

There are two longest runs of "w", so output both sentences.

Sample 3
Input
wwそれなww
Output
それな

Ignore the "w" at the beginning of the line.

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