Pro.ID1356 TitleBabelfish Title链接http://10.20.2.8/oj/exercise/problem?problem_id=1356 AC138 Submit484 Ratio28.51% 时间&空间限制描述You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. 输入Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters. 输出Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them. Input Input consists of up to 100,000 dictionary entries, followed by a blank line, followed by a message of up to 100,000 words. Each dictionary entry is a line containing an English word, followed by a space and a foreign language word. No foreign word appears more than once in the dictionary. The message is a sequence of words in the foreign language, one word on each line. Each word in the input is a sequence of at most 10 lowercase letters. Output Output is the message translated to English, one word per line. Foreign words not in the dictionary should be translated as "eh". Sample Input dog ogday Sample Output cat Hint 本题可用 hash 来做,AC之后,可学习用"trie树"来做。 Source 样例输入dog ogday 样例输出cat 提示本题可用 hash 来做,AC之后,可学习用"trie树"来做。 |