当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2138:Travel Games

题目描述
The cows are taking a trip to the lakes in Minnesota. Like everyone else, they are bored and are playing "travel games" to pass the time away.

In this travel game, the first cow thinks of a three letter word from the Sacred Travel Game Dictionary (STGD). The next cow in line must add a letter to the word (at the beginning, between two letters, or at the end) to make another word in the STGD. The cows are curious as to just how big the final word can be.

Given a dictionary of D (1 <= D <= 1000) words and a starting word, find any of the longest possible words that can be formed playing this travel game.
输入解释
* Line 1: The integer D followed by a space followed by a legal three letter word.

* Line 2 through D+1: Each line contains a legal word no longer than 80 characters, consisting only of lowercase letters, from the STGD.
输出解释
A single line with the longest word that can be formed by extending the input seed.
The input ensure the correct result will be unique.
输入样例
9 cal
cal
calf
calfs
call
calls
choral
chorale
coal
coral
输出样例
chorale
提示
[From the sequence: cal, coal, coral, choral, chorale]

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2138

最后修改于 2020-10-29T06:24:21+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000 65536