文件名称:abbreviate

  • 所属分类:
  • 其他小程序
  • 资源属性:
  • [Text]
  • 上传时间:
  • 2013-10-16
  • 文件大小:
  • 1kb
  • 下载次数:
  • 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.
(系统自动生成,下载前可以参看下载内容)

下载文件列表





abbreviate.txt

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org