2 shunfurh 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
caozhy   Ds   Rxr 2017.09.04 23:49
已采纳
fight_in_dl
fight_in_dl   Ds   Rxr 2017.09.04 18:21
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
MIMO标准信道模型(WINNERII简化)
WINNER-ITU信道模型的实现代码,并附有代码实现的介绍文档
基于winner 滤波平稳降噪效果
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-胜者树
胜者树是一种数据结构,特点如下:它是一棵完全二叉树。也就是说,除最后一层外,每一层上的节点数均达到最大值;在最后一层上只缺少右边的若干结点。这棵树的所有叶子结点是原始数据(见下文样例)。对于所有非叶子结点,取两个儿子中更优秀的值,就是父亲结点的值,故名胜者树。由于胜者树是完全二叉树,因此如果把根结点编号为1,第二层的结点分别是2、3,第三层是4、5、6、7……那么我们就能发现:每一个非叶子结点的左
Predict the Winner一个动态规划的问题解法详解
Predict the Winner
LeetCode----486. Predict the Winner 动态规划
最近在整理课本第六章动态规划的课后习题,就顺便找leetcode上的题目做啦,顺便复习。。 1 题目 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
[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
在尝试各种无监督学习方法来学习轴承振动信号的特征来进行故障诊断,最近看了关于Winner-take-all Autoencoder的论文和实现方法。参考:1. 论文:Winner-take-all Autoencoders2. 代码:a. Fully Connected WTAb. Convolutional WTA简单理解:1. spatial sparsity是指卷积层的每个feature ma
Be the Winner
博弈题如果知道其中的原理,结论很容ac #include"stdio.h" #include"string.h" int a[60000]; int main() {     int num1,num2,m,ans,i;     while(scanf("%d",&m)!=EOF)     {         num1=0;//计算充裕堆数《大于1》   num2=0;//计算