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

26514번 - HangMan 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB59191833.333%

문제

In the classic blackboard game HangMan you are given a word and attempt to guess the word by choosing a series of letters. In this program, you must determine if the provided letters are contained in the word prior to a body figure being drawn. One body part is added for each letter not contained in the word. The body figure below consists of the head shown by the letter "O", two body parts "|", 2 arms shown by equal signs "=", 2 hands shown by asterisks "*", and legs shown using a forward slash "/"and a back slash "\", 9 parts in all, drawn in order, top to bottom - from left to right, as shown below. Once all the letters of the word are found, the game ends and no further letters are read. The game also ends once the figure is completed. If no body parts are drawn, print the word “SAFE”.

 O
*=|=*
 |
 / \

입력

The first line contains a single positive integer, k, indicating the number of data sets. Each data set is on one line, and consists of a single word S (all capital letters), an integer N, followed by N distinct capital letters.

출력

The word and resulting hangman figure, according to the series of guesses provided by the letters. The body parts MUST align as shown, with the "*" on the left edge of the screen, and all other parts aligned accordingly. Exactly one blank line must follow each output.

제한

예제 입력 1

4
APLUS 8 A S E U G P I J
UIL 9 A B C D E F G H J
SALTLICK 9 E F G H I J K M N
GOOGLE 4 G O L E

예제 출력 1

APLUS
 O
+=|
UIL
 O
+=|=+
 |
 / \
SALTLICK
 O
+=|=+
 |
GOOGLE
SAFE

힌트

출처

School > PLU High School Programming Contest > PLU 2016 > Advanced 6번

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

출처

대학교 대회

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

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