/ OPS / 题库 /

Jumble

Jumble

#描述#
Your objective for this question is to develop a program which will take in a "vocabulary list" of real words, and a "jumbled list" of words whose letters are scrambled, and for each word return either the list of words that the jumbled word could be, or the fact that the jumbled word couldn't be any word it knows.

#格式#
##输入格式##
Your inputs include two blocks.
The first block is of real words newline delimited that will be the program's "knowledge base".
The second block is of the jumbled word list newline delimited.
A jumbled word is a word whose letters have be reordered. For example, the real word ball may produce the jumbled word labl.
Other considerations: For simplicity, you may assume that your vocabulary is no more than 1000 words and that the number of jumbled words to consider is no more than 50 words. You SHOULD NOT assume your words in either list are "one word", i.e., your words may contain spaces.

##输出格式##
Your output should follow the format below. Jumbled words that match the vocabulary should return those words in a space delimited list and ASCII ordered, but with the space after the last word replaced with a newline. Jumbled words that do not match should return "no match" as a result.

#样例1#
##样例输入1##

ball
bear
tab
bat
trickle down
lick
click
clock
rim
mir
rmi
 
abll
irm
abt
kcja

##样例输出1##

abll: ball
irm: mir rim rmi
abt: bat tab
kcja: no match

#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1274
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者