POJ 1934 Trip LCA及其所有不重复的串
来源:互联网 发布:淘宝小号购买平台 编辑:程序博客网 时间:2024/05/16 08:29
Trip
Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1629 Accepted: 372
Description
Alice and Bob want to go on holiday. Each of them has planned a route, which is a list of cities to be visited in a given order. A route may contain a city more than once.
As they want to travel together, they have to agree on a common route. None wants to change the order of the cities on his or her route or add other cities. Therefore they have no choice but to remove some cities from the route. Of course the common route should be as long as possible.
There are exactly 26 cities in the region. Therefore they are encoded on the lists as lower case letters from 'a' to 'z'.
As they want to travel together, they have to agree on a common route. None wants to change the order of the cities on his or her route or add other cities. Therefore they have no choice but to remove some cities from the route. Of course the common route should be as long as possible.
There are exactly 26 cities in the region. Therefore they are encoded on the lists as lower case letters from 'a' to 'z'.
Input
The input consists of two lines; the first line is Alice's list, the second line is Bob's list.
Each list consists of 1 to 80 lower case letters with no spaces inbetween.
Each list consists of 1 to 80 lower case letters with no spaces inbetween.
Output
The output should contain all routes that meet the conditions described above, but no route should be listed more than once. Each route should be printed on a separate line. There is at least one such non-empty route, but never more than 1000 different ones. Output them in ascending order.
Sample Input
abcabcaaacbacba
Sample Output
ababaabacaabcbaacabaacacaacbaaacbca
Source
CEOI 2003
- POJ 1934 Trip LCA及其所有不重复的串
- poj 1934 Trip 所有最长公共子序列 仍然WA
- POJ 1934 Trip(LCS+枚举+输出所有路径)
- 找出字符串中所有重复的字符及其重复次数
- POJ 1934 Trip DP
- poj 1934 Trip
- poj 1934 Trip (LCS)
- POJ 1934 Trip 笔记
- 字符串的所有不重复组合
- 生成所有不重复的组合
- 找出所有最长连续重复子串及其个数
- 找出所有最长连续重复子串及其个数
- java 找出所有最长连续重复子串及其个数
- MySQL查询某个字段不重复的所有记录
- MySQL查询某个字段不重复的所有记录
- MySQL查询某个字段不重复的所有记录
- MySQL查询某个字段不重复的所有记录
- mysql查询某字段不重复的所有行
- PT8.49 PIA 安装问题
- 关于博文来源的声明
- ASP.NET操作Excel实例
- 未来五年程序员应当具备的十项技能
- 在交易数据库中发现关联规则
- POJ 1934 Trip LCA及其所有不重复的串
- 汇编实现从键盘接收一个字母输出大写
- 朝着梦想努力
- ASP.NET 2.0防止同一用户同时登陆
- December 10th Friday
- 基于xoops同步发送邮件和站内信代码
- extern "C"
- 红蓝眼镜支持的stero渲染(立体眼镜)
- hibernate 里用到的日志系统slf4j