文件名称:abbreviate
-
所属分类:
- 标签属性:
- 上传时间:2013-10-16
-
文件大小:607byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
最近情报人员得到了一些经过加密的文章,每个单词都很长。破译人员想到先把单词化简一下,方法是吧每个单词尽量取短些的前缀,但所有的前缀不能是其它单词的前缀。这个任务现在就交给你来完成。
解释:“字符串s1 是s2的前缀”是说把字符串 s2的后面去掉某些,只保留与 s1相同长度时, s2就与 s1完全相同。如“ abc”是“ abcaade”和“ abc”的前缀,但不是“ ababc”的前缀。
单词数N,1≤N≤50;每个单词长度不超过50;并且单词都由小写字母构成。保证所给单词没有一个单词是另一个单词的前缀。
输入文件:
第一行一个整数N,表示单词个数。
下面N行,每行一个单词。
输出文件
共N行,每行一个单词,是对应上面的N个单词化简后的单词。-Recent intelligence officers got some encrypted article, each word is very long. Decipher who think first word about simplification, is it possible to take each word prefixes shorter, but not all of the prefix is the prefix of other words. This task is now to you to complete. Explained: " prefix strings s1 is s2" is that behind the string s2 to remove some, leaving only the same length with s1, s2 and s1 on the same. Such as " abc" is the " abcaade" and " abc" prefix, but not " ababc" prefix. The number of words N, 1 ≤ N ≤ 50 each word length does not exceed 50 and word constituted by lowercase letters. To ensure that the word is a word that is not a prefix of another word. Input file: The first line an integer N, the number of words. The following N lines, one word per line. Output file of N lines, each word is the N word corresponding to the above the simplified words.
解释:“字符串s1 是s2的前缀”是说把字符串 s2的后面去掉某些,只保留与 s1相同长度时, s2就与 s1完全相同。如“ abc”是“ abcaade”和“ abc”的前缀,但不是“ ababc”的前缀。
单词数N,1≤N≤50;每个单词长度不超过50;并且单词都由小写字母构成。保证所给单词没有一个单词是另一个单词的前缀。
输入文件:
第一行一个整数N,表示单词个数。
下面N行,每行一个单词。
输出文件
共N行,每行一个单词,是对应上面的N个单词化简后的单词。-Recent intelligence officers got some encrypted article, each word is very long. Decipher who think first word about simplification, is it possible to take each word prefixes shorter, but not all of the prefix is the prefix of other words. This task is now to you to complete. Explained: " prefix strings s1 is s2" is that behind the string s2 to remove some, leaving only the same length with s1, s2 and s1 on the same. Such as " abc" is the " abcaade" and " abc" prefix, but not " ababc" prefix. The number of words N, 1 ≤ N ≤ 50 each word length does not exceed 50 and word constituted by lowercase letters. To ensure that the word is a word that is not a prefix of another word. Input file: The first line an integer N, the number of words. The following N lines, one word per line. Output file of N lines, each word is the N word corresponding to the above the simplified words.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
abbreviate.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.