Xâu con đối xứng dài nhất 1

View as PDF



Problem type
Points: 7 (p) Time limit: 1.0s Memory limit: 1G Input: stdin Output: stdout

Cho một xâu S, độ dài không quá 1000 kí tự.

Yêu cầu:

Tìm palindrome dài nhất là xâu con của S (Xâu con là một dãy các kí tự liên tiếp).

Dữ liệu vào:

Ghi xâu S

Dữ liệu ra:

Ghi xâu con đối xứng dài nhất, nếu có nhiều hơn 1 xâu con thì chỉ ghi ra xâu con đầu tiên tìm thấy, tính từ trái sang phải

Sample
Input
aaabccdd
Output
aaa
Giải thích
Dữ liệu vào luôn đảm bảo có kết quả

Comments

There are no comments at the moment.