CF208A.Dubstep

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of old songs and make dubstep remixes from them.

Let's assume that a song consists of some number of words. To make the dubstep remix of this song, Vasya inserts a certain number of words "WUB" before the first word of the song (the number may be zero), after the last word (the number may be zero), and between words (at least one between any pair of neighbouring words), and then the boy glues together all the words, including "WUB", in one string and plays the song at the club.

For example, a song with words "I AM X" can transform into a dubstep remix as "WUBWUBIWUBAMWUBWUBX" and cannot transform into "WUBWUBIAMWUBX".

Recently, Petya has heard Vasya's new dubstep track, but since he isn't into modern music, he decided to find out what was the initial song that Vasya remixed. Help Petya restore the original song.

瓦西娅在伯兰最好的夜总会担任DJ,他经常在演出中使用Dubstep音乐。最近,他决定选取几首老歌,并将它们改编成Dubstep风格的混音曲。

假设一首歌由若干个单词组成。为了制作这首歌的Dubstep混音版,瓦西娅会在原歌第一个单词前插入若干个单词“WUB”(数量可以为零),在最后一个单词后也插入若干个“WUB”(数量也可以为零),并在每两个相邻单词之间至少插入一个“WUB”,然后将所有单词(包括插入的“WUB”)拼接成一个字符串,在夜总会播放该混音曲。

例如,一首原歌词为“I AM X”的歌曲,可被改编为Dubstep混音版:“WUBWUBIWUBAMWUBWUBX”,但不能改编为“WUBWUBIAMWUBX”。

最近,佩佳听到了瓦西娅的新Dubstep曲目,但由于他并不热衷于现代音乐,他决定找出瓦西娅最初改编的原曲是什么。请帮助佩佳还原出原始歌曲。

输入格式

The input consists of a single non-empty string, consisting only of uppercase English letters, the string's length doesn't exceed 200 characters. It is guaranteed that before Vasya remixed the song, no word contained substring "WUB" in it; Vasya didn't change the word order. It is also guaranteed that initially the song had at least one word.

输入为一个非空字符串,仅由大写英文字母组成,字符串长度不超过 200 个字符。保证在瓦西娅(Vasya)对歌曲进行混音之前,没有任何单词包含子串 “WUB”;瓦西娅未改变单词的顺序。同时保证原始歌曲中至少包含一个单词。

输出格式

Print the words of the initial song that Vasya used to make a dubsteb remix. Separate the words with a space.

输出瓦夏用来制作 Dubstep 改编曲的原歌曲中的单词。单词之间用空格分隔。

输入输出样例

  • 输入#1

    WUBWUBABCWUB

    输出#1

    ABC
  • 输入#2

    WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB

    输出#2

    WE ARE THE CHAMPIONS MY FRIEND

说明/提示

In the first sample: "WUBWUBABCWUB" = "WUB" + "WUB" + "ABC" + "WUB". That means that the song originally consisted of a single word "ABC", and all words "WUB" were added by Vasya.

In the second sample Vasya added a single word "WUB" between all neighbouring words, in the beginning and in the end, except for words "ARE" and "THE" — between them Vasya added two "WUB".

在第一个样例中:“WUBWUBABCWUB” = “WUB” + “WUB” + “ABC” + “WUB”。这意味着歌曲原本仅由一个单词“ABC”组成,所有“WUB”均为瓦夏添加。

在第二个样例中,瓦夏在所有相邻单词之间、开头和结尾各添加了一个单词“WUB”,但“ARE”与“THE”之间除外——在它们之间,瓦夏添加了两个“WUB”。

输入解题思路,AI测评打分。不知道怎么写?

首页