天天看点

UVA 11404 Palindromic Subsequence

Time Limit: 3000ms

Memory Limit: 131072KB

This problem will be judged on UVA. Original ID: 11404

64-bit integer IO format: %lld      Java class name: Main

A Subsequence is a sequence obtained by deleting zero or more characters in a string. A Palindrome is a string which when read from left to right, reads same as when read from right to left. Given a string, find the longest palindromic subsequence. If there are many answers to it, print the one that comes lexicographically earliest.

Constraints

Maximum length of string is 1000.

Each string has characters `a' to `z' only.

Input consists of several strings, each in a separate line. Input is terminated by EOF.

For each line in the input, print the output in a single line.

UVA 11404 Palindromic Subsequence
UVA 11404 Palindromic Subsequence

View Code

夜空中最亮的星,照亮我前行