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

13718번 - Tavan 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 32 MB214847747.826%

문제

Little Željko has been reading his grandma’s old letters in the attic and has come across a word of length N. Unfortunately, he couldn’t make out what it said because of the spilled ink. He rewrote the word on a piece of paper by replacing each of the M illegible letters with the character ‘#’. He handed the piece of paper to his grandma and she gave him K different candidates for each of the illegible letters. After that, Željko wrote all the possible words in a notebook and decided to closely look at their properties in order to determine what the original words was. After seeing the words written down in the notebook, his grandma realized that the word they’re looking for is the Xth one in alphabetical order. Željko had the sniffles the day they learned the alphabet in school, so he’s asking you for your help with determining the original word.

입력

The first line of input contains the integers N, M, K and X (1 ≤ N ≤ 500, 1 ≤ M ≤ N, 1 ≤ K ≤ 26, 1 ≤ X ≤ 109).
The second line of input contains the word of length N that Željko wrote on a piece of paper, consisting of lowercase letters of the English alphabet and the character ‘#’. Each of the following M lines contains one word of length K, the ith of these words consisting of letters that could replace the ith illegible letter.

Number X will always be less than or equal to the total number of words that can be constructed.

출력

The first line of output must contain the Xth word in alphabetical order.

제한

예제 입력 1

9 2 3 7
po#olje#i
sol
znu

예제 출력 1

posoljeni

예제 입력 2

4 1 2 2
#rak
zm

예제 출력 2

zrak

힌트

The possible words, in aphabetical order, are: “pololjeni”, “pololjeui”, “pololjezi”, “poooljeni”, “poooljeui”, “poooljezi”, “posoljeni”, “posoljeui”, “posoljezi”.

출처

Contest > Croatian Open Competition in Informatics > COCI 2016/2017 > Contest #2 2번

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

출처

대학교 대회

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

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