|
||||||||||
Divide GameTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 317 Accepted Submission(s): 66 Problem Description Divide Game is a combination of the two games. First, given a string, one of the player's task is to divide the string into several nonempty strings, we define a legal division generates several shorter strings in the order as they are in the original string, and every two adjacent strings are not similar. We call two strings are similar only if they have at least one character whose number of occurrences in the two strings are equal and not zero. Then they two play another totally different sub-divide game. To ensure fairness, another player has the first chance. In this game, two players make an operation in turn. In a round, a player chooses one string, divides the pile into two non-similar strings, if he can't divide it, then he just moves the string away. The one who gets the last operation is the winner. Now iSea have a clever challenger, who always choose the optimum strategy, if they two play the divide game, and iSea have the chance to divide the string in the first game, can he win the final game? Input There are several test cases in the input. Each test case only contain one string (length <= 50000, and only include uppercase), indicating the original string. The input terminates by end of file marker. Output For each test case, output "Yes" if iSea can win, otherwise output "No". Sample Input
Sample Output
Author iSea@WHU Source | ||||||||||
|