shunfurh 于 2017.09.04 17:25 提问

Be the Winner

Let's consider m apples divided into n groups. Each group contains no more than 15 apples, arranged in a line. You can take any number of consecutive apples at one time.

For example "@@@" can be turned into "@@" or "@" or "@ @"(two piles).

Two people get apples one after another and the one who takes the last is the loser.

Fra wants to know in which situations he can win by playing strategies (that is, no matter what action the rival takes, fra will win).

Input

You will be given several cases. Each test case begins with a single number n (1 <= n <= 3), followed by a line with n numbers, the number of apples in each pile. There is a blank line between cases.

Output

If a winning strategies can be found, print a single line with "Yes", otherwise print "No".

Sample Input

2
2 2

1
3

Sample Output

No
Yes

2个回答

caozhy      2017.09.04 23:49

fight_in_dl      2017.09.04 18:21

MIMO标准信道模型（WINNERII简化）
WINNER-ITU信道模型的实现代码，并附有代码实现的介绍文档

https://en.wikipedia.org/wiki/Wiener_filter Wiener filter solutions The Wiener filter problem has solutions for three possible cases: one where a noncausal filter is acceptable (requiring an inf
Winner Tree-胜者树

Predict the Winner一个动态规划的问题解法详解
Predict the Winner
LeetCode----486. Predict the Winner 动态规划

[LeetCode]486. Predict the Winner
https://leetcode.com/problems/predict-the-winner/ 给一个int数组，两个人依次从数组任意一头拿一个数，判断player1最后拿到的总数是否更大 两人依次拿，如果P1赢，则P1拿的>P2拿的。我们把P1拿的视为“+”，把P2拿的视为“-”，如果最后结果大于等于0则P1赢。 因此对于递归来说，beg ~ end的结果为max(
486. Predict the Winner
Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a player picks a
Leetcode——486. Predict the Winner
https://leetcode.com/problems/predict-the-winner/?tab=DescriptionDescriptionGiven an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array follo
Winner-take-all Autoencoder

Be the Winner