版本3和4间的区别
于2006-04-21 21:18:44修订的的版本3
大小: 1661
编辑: czk
备注:
于2008-02-23 15:35:19修订的的版本4
大小: 1669
编辑: localhost
备注: converted to 1.6 markup
删除的内容标记成这样。 加入的内容标记成这样。
行号 11: 行号 11:
attachment:2725_1.gif {{attachment:2725_1.gif}}
行号 21: 行号 21:
attachment:2725_2.gif {{attachment:2725_2.gif}}

Digital Deletions

Time limit: 1 Seconds

Memory limit: 32768K

Digital deletions is a two-player game. The rule of the game is as following.

  • Begin by writing down a string of digits (numbers) that's as long or as short as you like. The digits can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and appear in any combinations that you like. You don't have to use them all. Here is an example:

2725_1.gif

  • On a turn a player may either:
    • Change any one of the digits to a value less than the number that it is. (No negative numbers are allowed.) For example, you could change a 5 into a 4, 3, 2, 1, or 0.
    • Erase a zero and all the digits to the right of it.
  • The player who removes the last digit wins.
  • The game that begins with the string of numbers above could proceed like this:

2725_2.gif

Now, given a initial string, try to determine can the first player win if the two players play optimally both.

1. Input

The input consists of several test cases. For each case, there is a string in one line.

The length of string will be in the range of [1,6]. The string contains only digit characters.

Proceed to the end of file.

2. Output

Output Yes in a line if the first player can win the game, otherwise output No.

3. Sample Input

0
00
1
20

4. Sample Output

Yes
Yes
No
No

Author: ZHENG, Jianqiang

Problem Source: Zhejiang University Local Contest 2006, Preliminary


http://acm.zju.edu.cn/show_problem.php?pid=2725

zju2725 (2008-02-23 15:35:19由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.