F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Divide Game

Time 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
AA ABC
 

Sample Output
No Yes
 

Author
iSea@WHU
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-04 21:30:58, Gzip enabled