题目来源:http://poj.org/problem?id=1035
Spell checker
Time Limit: 2000MS |
Memory Limit: 65536K |
Total Submissions: 27099 |
Accepted: 9915 |
Description
You, as a member of a development team for a newspell checking program, are to write a module that will check the correctnessof given words using a known dictionary of all correct words in all theirforms.
If the word is absent in the dictionary then it can be replaced by correctwords (from the dictionary) that can be obtained by one of the followingoperations:
?deleting of one letter from the word;
?replacing of one letter in the word with an arbitrary letter;
?inserting of one arbitrary letter into the word.
Your task is to write the program that will find all possible replacements fromthe dictionary for every given word.
Input
The first part of the input file contains allwords from the dictionary. Each word occupies its own line. This part isfinished by the single character '#' on a separate line. All words aredifferent. There will be at most 10000 words in the dictionary.
The next part of the file contains all words that are to be checked. Each wordoccupies its own line. This part is also finished by the single character '#'on a separate line. There will be at most 50 words that are to bech