英语翻译Time Limit:10 Seconds Memory Limit:32768 KB The FBI is conducting a surveillance of a known criminal hideout which serves as a communication center for a number of men and women of nefarious intent.Using sophisticated decryption software

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/19 22:33:17
英语翻译Time Limit:10 Seconds Memory Limit:32768 KB The FBI is conducting a surveillance of a known criminal hideout which serves as a communication center for a number of men and women of nefarious intent.Using sophisticated decryption software

英语翻译Time Limit:10 Seconds Memory Limit:32768 KB The FBI is conducting a surveillance of a known criminal hideout which serves as a communication center for a number of men and women of nefarious intent.Using sophisticated decryption software
英语翻译
Time Limit:10 Seconds Memory Limit:32768 KB
The FBI is conducting a surveillance of a known criminal hideout which serves as a communication center for a number of men and women of nefarious intent.Using sophisticated decryption software and good old fashion wiretaps,they are able to decode any e-mail messages leaving the site.However,before any arrest warrants can be served,they must match actual names with the user ID's on the messages.While these criminals are evil,they're not stupid,so they use random strings of letters for their ID's (no dillingerj ID's found here).The FBI knows that each criminal uses only one ID.The only other information they have which will help them is a log of names of the people who enter and leave the hideout.In many cases,this is enough to link the names to the ID's.
Input
Input consists of one problem instance.The first line contains a single positive integer n indicating the number of criminals using the hideout.The maximum value for n will be 20.The next line contains the n user ID's,separated by single spaces.Next will be the log entries in chronological order.Each entry in the log has the form type arg,where type is either E,L or M; E indicates that criminal arg has entered the hideout; L indicates criminal arg has left the hideout; M indicates a message was intercepted from user ID arg.A line containing only the letter Q indicates the end of the log.Note that not all user ID's may be present in the log but each criminal name will be guaranteed to be in the log at least once.At the start of the log,the hideout is presumed to be empty.All names and user ID's consist of only lowercase letters and have length at most 20.Note:the line containing only the user ID's may contain more than 80 characters.
Output
Output consists of n lines,each containing a list of criminal names and their corresponding user ID's,if known.The list should be sorted in alphabetical order by the criminal names.Each line has the form name:userid,where name is the criminal's name and userid is either their user ID or the string if their user ID could not be determined from the surveillance log.
This problem contains multiple test cases!
The first line of a multiple input is an integer N,then a blank line followed by N input blocks.Each input block is in the format indicated in the problem description.There is a blank line between input blocks.
The output format consists of N output blocks.There is a blank line between output blocks.
Sample Input
1
7
bigman mangler sinbad fatman bigcheese frenchie capodicapo
E mugsy
E knuckles
M bigman
M mangler
L mugsy
E clyde
E bonnie
M bigman
M fatman
M frenchie
L clyde
M fatman
E ugati
M sinbad
E moriarty
E booth
Q
Sample Output
bonnie:fatman
booth:
clyde:frenchie
knuckles:bigman
moriarty:
mugsy:mangler
ugati:sinbad
Source:East Central North America 2001
能否根据所翻译的程序编程,(用c++语言)做到的加分

英语翻译Time Limit:10 Seconds Memory Limit:32768 KB The FBI is conducting a surveillance of a known criminal hideout which serves as a communication center for a number of men and women of nefarious intent.Using sophisticated decryption software
期限:1000 MS 记忆界限:10000 K
总数委托:579 接受:218
描述
FBI 正在引导为邪恶的意图许多的男人和女人视为沟通中心的已知犯罪的隐匿处的一个监视. 使用复杂的 decryption 软件和好旧的流行窃听, 他们能够解码任何的电子邮件信息离开位置. 然而,在任何的逮捕之前正当理由可能被服侍,他们一定使真实的名字与在信息上的使用者身份证的相配. 当这些罪犯是邪恶的时候,他们不是愚蠢的,因此,他们使用信的任意线为
他们的身份证.(在这里被发现的没有 dillingerj 身份证) FBI 每个罪犯只使用一个身份证. 唯一的其他数据他们有哪一将会帮助他们是进入,而且留下隐匿处的人名字的一个圆木. 在许多情况,这对把名字和身份证的相连是充足的.
输入
输入由一个问题例证所组成. 第一条行包含单一积极的完整事物 n 指出罪犯的数字使用隐匿处. 最大的价值为 n 将会是 20 . 下一条行包含 n 使用者身份证的,被单一空间分开. 下一个将会是按年代序的次序圆木进入. 圆木的每个进入有形式类型 arg, 类型在哪里或 E , L 或 M: E 指出犯罪的 arg 已经进入隐匿处; L 指出犯罪的 arg 已经留下隐匿处; M 指出一个信息从使用者身份证 arg 被拦截. 只有包含信 Q 的一条线指出圆木的结束.注意不所有的使用者身份证在圆木中可能是礼物,但是每个犯罪的名字将会被保证至少曾经是在圆木中. 在圆木的开始,隐匿处被假定是空的. 所有的名字和使用者身份证最多由唯一的小写字母信所组成而且有长度 20. 注意: 只有包含使用者身份证的线可能包含超过 80个个性.
输出
输出由 n 线 , 每个包含一连串的犯罪名字和他们的对应使用者身份证所组成, 如果已知的. 目录应该在犯罪的名字旁边的依字母顺序的次序中被分类. 每条线有形式名字: userid, 名字是罪犯的名字哪里,而且 userid 是或他们的使用者身份证或线? 如果他们的使用者身份证从监视圆木不可以被决定.
抽取样品输入
7
bigman mangler sinbad fatman bigcheese frenchie capodicapo
E mugsy
E 指节
M bigman
M mangler
L mugsy
E clyde
漂亮的 E
M bigman
M fatman
M frenchie
L clyde
M fatman
E ugati
M sinbad
E moriarty
E 亭
Q
抽取样品输出
暗示
漂亮的: fatman
亭:?
clyde: frenchie
指节: bigman
moriarty:?
mugsy: mangler
ugati: sinbad
进口
东方中央的北美国 2001