| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 59 | 19 | 18 | 33.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.
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
APLUS O +=| UIL O +=|=+ | / \ SALTLICK O +=|=+ | GOOGLE SAFE