2017.4.17解题报告f
来源:互联网 发布:伊本白图泰 知乎 编辑:程序博客网 时间:2024/05/24 01:02
f
问题
状态
排名
竞赛&作业
[
问题
状态
排名
OI排名
统计
]
登录
欢迎关注微信公众号onlinejudge
问题 F: SUBSTRING
时间限制: 1 Sec 内存限制: 128 MB
提交: 9 解决: 3
[提交][状态][讨论版]
题目描述
You are given a string input. You are to find the longest substring of input such that the reversal of the
substring is also a substring of input. In case of a tie, return the string that occurs earliest in input.
Note well: The substring and its reversal may overlap partially or completely. The entire original string
is itself a valid substring .
The best we can do is find a one character substring, so we implement the tiebreaker rule of taking the
earliest one first.
输入
The first line of input gives a single integer, 1 ≤ N ≤10, the number of test cases. Then follow, for each
test case, a line containing between 1 and 50 characters, inclusive. Each character of input will be an
uppercase letter ('A'-'Z').
输出
Output for each test case the longest substring of input such that the reversal of the substring is also a
substring of input
样例输入
3
ABCABA
XYZ
XCVCX
样例输出
ABA
X
XCVCX
提示
[提交][状态]
题意概括:把字符串逆序,如果逆序后的字符串中的子串在原串中也出现就输出,如果有多个,输出长度最长的子串。如果长度相等输出第一个。
- 2017.4.17解题报告f
- F - Babelfish解题报告
- cqm解题报告F
- 7/21 F 解题报告
- F - Babelfish解题报告(黄杰)
- F - Dividing解题报告(来自网络)
- F - Summits解题报告(来自网络)
- F - Pipe Fitters解题报告(熊禾强)
- HDU 4734 F(x) 解题报告
- F - The Hardest Problem Ever解题报告
- F - The Suspects(解题报告)
- 山东省第二届ACM省赛 F题 Manhattan 解题报告
- F - Babelfish解题报告(map函数)(陈渊)
- F - Hand in Hand HDU - 3926(解题报告)
- Codeforces Round #397 Problem F. Souvenirs 解题报告
- 解题报告:Educational Codeforces Round 24 D,E,F
- 2016.9.17测试解题报告
- 解题报告
- Android 强引用,弱引用,软引用,虚引用
- Leetcode 284. Peeking Iterator
- Android 中的线程池
- Java基础之equal()与hashcode()函数分析
- WCF-Binding
- 2017.4.17解题报告f
- ssm挖坑,遇到的问题
- 10天训练营----古诗
- 自动化测试流程图
- xib等按比例布局
- Python函数调用的下划线缺省参数“_”问题
- (原创)分享自己写的几个工具类(三)Toast和Log管理类
- 使用cookie完成用户自动登录
- HTML CSS + DIV实现整体布局