Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

2902.   palindrome
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 1128   Accepted Runs: 582



A palindrome is a sequence of one or more characters that reads the same from the left as it does from the right. For example, SHAHS are palindromes, but SHAKS is not.

Your job, should you choose to accept it, is to write a program that reads a sequence of strings and for each string determines the number of UNIQUE largest palindromes that are substrings and also print the largest length.

Input and Output:

The input file consists of a number of strings (one per line), of at most 80 characters each, starting in column 1. Strings contain only upper case letters. For each non-empty input line,the output consists of one line containing the largest length of the palindromes and the number of UNIQUE largest palindromes.

Sample Input:

SHAKIL
BABU
BABUAAA

Sample Output:

1 6
3 1
3 2

Problem Setter: MD. SHAKIL AHMED. (CUET AGRODUT)



Source: New Year Challenge Contest
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz