Babelfish

TimeLimit:1000MS  MemoryLimit:128MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem 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.


题目修改如下:

先输入一个n(1 ≤ n ≤ 100000),表示字典中单词对的数量。单词对由“英文单词 - 外语单词”组成。

接下来n行,每行一个单词对,每个单词长度不超过10,且只包含小写字母。

然后输入一个m(1 ≤ m ≤ 100000),表示询问的次数。

每次询问输入一串外语单词,如果能在字典中找到对应的单词对,则输出对应的英文单词,否则,输出“eh”。


注:字典中的外语单词不会重复

Output
Output is the message translated to English, one word per line. Foreign words not in the dictionary should be translated as "eh".
SampleInput
5
dog ogday
cat atcay
pig igpay
froot ootfray
loops oopslay
3
atcay
ittenkay
oopslay
SampleOutput
cat
eh
loops
Submit
题目统计信息详细
总AC数70
通过人数41
尝试人数53
总提交量325
AC率12.62%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: