Logo
(追記) (追記ここまで)

17987번 - Howl 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB35920814266.047%

문제

Returning to the Beautiful Gloomy Outback (BGO) after a strenuous trip to the city, you hear a faint howl in the distance. Instantly you realize it is your friend Fenrir inviting you to a howling contest.

In order to make an impressive howl that wins the contest, you know that your howl must fulfill the following criteria in order to be valid:

  • It must consist of a combination of the letters A, H, O and W. Each letter must occur at least once.
  • The howl can not contain two consecutive W’s, or two consecutive H’s.
  • The howl can not contain an H followed immediately by a W or an A.
  • There can never be an A after the first occurrence of an O.

Can you produce a longer howl than Fenrir and win the contest?

입력

The first and only line of input contains a single word, the howl of Fenrir. Since Fenrir is a proper wolf, his howls are always valid. Writing down Fenrir’s howl will require at most 1 MB of computer memory.

출력

A valid howl which will win the howling contest.

제한

예제 입력 1

AAHOOW

예제 출력 1

AWAWHOO

힌트

출처

Contest > Bergen Open > Bergen Open 2019 H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /