Game of Taking Stones
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1522 Accepted Submission(s): 515
Problem Description
Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: One scheme is that you can take any number of stones in any one pile while the alternative is to take the same amount of stones at the same time in two piles. In the end, the first person taking all the stones is winner.Now,giving the initial number of two stones, can you win this game if you are the first to take stones and both sides have taken the best strategy?
Input
Input contains multiple sets of test data.Each test d

这是一个关于威佐夫博弈的问题,参赛者面对两堆石头,按规则轮流取石。题目要求通过二分搜索精确到小数点后100位找到胜利条件。输入包含多组数据,每组包含两堆石头的数量,输出是根据最佳策略判断是否能赢得游戏。样例输入和输出展示了具体的游戏实例。
最低0.47元/天 解锁文章
1644

被折叠的 条评论
为什么被折叠?



