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

24747번 - Letterle 다국어

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

문제

A new game is played by giving the user up to seven guesses to figure out a letterle (pronounced: letter-el). A letterle consists of five letters (A-Z), in a specific order. After each guess, the user is given feedback as to the correctness of their guess. Feedback is provided as a five letter string containing only the following letters: X, Y and G.

  • X = letter in this position does not appear in the letterle
  • Y = letter in this position appears in the letterle, but it is not in the correct position
  • G = letter in this position is correct (good).

For this problem, you will write a program that generates the feedback for up to seven guesses for a supplied letterle.

입력

The first line of input contains a five character string of capital letters (A-Z) that are the letterle. The next seven lines contain guesses that the program must evaluate and generate feedback for the user.

출력

Output consists of one or more lines. For each guess, if the guess is correct, the output line is WINNER and the program should not process any more input. If the guess is incorrect, and this is the seventh guess, the output line is “LOSER”. Otherwise, the output line is a five character string where each position has one of X, Y or G (as described above). First, any position that a letter is correct, should have a G. Then, any position where a letter is not in the letterle, should contain an X. The remaining positions should contain a Y indicating the letter is correct, but in the wrong position.

제한

예제 입력 1

LIMIT
ABCDE
FGHIJ
KLMNO
PQRST
LIMIT
LEMIT
LAMIT

예제 출력 1

XXXXX
XXXGX
XYGXX
XXXXG
WINNER

힌트

출처

ICPC > Regionals > North America > Greater New York Region > 2021 Greater New York Programming Contest L번

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

출처

대학교 대회

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

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