文件名称:ural1297
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.06kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
算法分析:将整个字符串反过来写在原字符串后面。中间用一个特殊的字符隔开,中间我用的是0,最后面我又加了一个字符1, 如果再加0 很可能会出错。(最后一个应该也可以不加),这样就把问题变为了求这个新的字符串的某两个后缀的最长公共前缀
注意:提供一组数据 zzzdzaadzzz 答案应该输出zzz,而如果不仔细的话程序可能会输入zdz,因为有可能答案前缀没有相邻,所这里就得加上一个循环判断处理。因为这个WA三次
-Algorithm analysis: the entire string in turn write back the original string. The middle separated by a special character, the middle I use 0, the last face I added a character one, if there is likely to be wrong 0. (The last one should also not), so put the problem into a request string of a new two longest common prefix suffix NOTE: to provide the answer should be a set of data zzzdzaadzzz output zzz, and if not careful, then procedures may enter zdz, because there may be no answer to the prefix is adjacent to the loop where a judge had to deal with. WA three times because of this
注意:提供一组数据 zzzdzaadzzz 答案应该输出zzz,而如果不仔细的话程序可能会输入zdz,因为有可能答案前缀没有相邻,所这里就得加上一个循环判断处理。因为这个WA三次
-Algorithm analysis: the entire string in turn write back the original string. The middle separated by a special character, the middle I use 0, the last face I added a character one, if there is likely to be wrong 0. (The last one should also not), so put the problem into a request string of a new two longest common prefix suffix NOTE: to provide the answer should be a set of data zzzdzaadzzz output zzz, and if not careful, then procedures may enter zdz, because there may be no answer to the prefix is adjacent to the loop where a judge had to deal with. WA three times because of this
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ural1297.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.