2 shunfurh shunfurh 于 2017.01.16 22:36 提问

A multiplication game

Description
两个人轮流用2~9来乘n,使n不断扩大,n开始为1。当给一个固定值k,谁先使n超过k谁赢
Input
多组用例,每组用例占一行为一个整数k,以文件尾结束输入
Output
对于每组用例,输出谁赢(Stan为先手)
Sample Input
162
17
34012226
Sample Output
Stan wins.
Ollie wins.
Stan wins.

1个回答

caozhy
caozhy   Ds   Rxr 2017.01.23 23:50
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
A Multiplication Game (博弈,规律)
Stan and Ollie play the game of multiplication by multiplying an integer p by one of the numbers 2 to 9. Stan always starts with p = 1, does his multiplication, then Ollie multiplies the number, then S
HDU 1517 A Multiplication Game (博弈-求sg)
HDU 1517 A Multiplication Game (博弈-求sg) 题目大意: Stan 和 Ollie 两个人玩游戏, 一开始数字是 1,两个人轮流,Stan 先手,每个人选择 2~9 里面的一个一直乘以起初的数字,直到某个人乘到 这个数大于等于 n 就算赢,n给定,问你谁必然赢。 解题思路: 这题我没找出SG函数(必胜必输)的规律,只能用DP的方法求出每种状态的必胜必输状态。 2~9 ,依次其实可以用 2 3 5 7 这几个数得到,因此每个状态只需要记录2 3 5 7 这几个数的
HDU 1517 A Multiplication Game 小聪明博弈
A Multiplication Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1517 Appoint description:  System Crawler  (2016-04-20) Des
POJ1651Multiplication Puzzle题解动态规划DP
Multiplication PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3460 Accepted: 2034<br />DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out
POJ 1651-Multiplication Puzzle
Multiplication Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5792 Accepted: 3506 Description The multiplication puzzle is played with a row of cards, each containing a single
HDOJ 1517 A Multiplication Game
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1517 A Multiplication Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5267   
hdu 1517 - A Multiplication Game(博弈)
这道题目稍微上点难度了。 题意:(from:http://www.cnblogs.com/kuangbin/archive/2011/08/29/2158581.html) 2 个人玩游戏,从 1 开始,轮流对数进行累乘,直到超过一个指定的值。 解题思路: 如果输入是 2 ~ 9 ,因为Stan 是先手,所以Stan 必胜 如
POJ 2505 && HDU 1517 A multiplication game(博弈论)
Description 两个人轮流用2~9来乘n,使n不断扩大,n开始为1。当给一个固定值k,谁先使n超过k谁赢 Input 多组用例,每组用例占一行为一个整数k,以文件尾结束输入 Output 对于每组用例,输出谁赢(Stan为先手) Sample Input 162 17 34012226 Sample Output Stan wins. Ollie wins. St
HDU 1517 && poj 2505 A Multiplication Game (基础博弈)
A Multiplication Game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2264    Accepted Submission(s): 1300 Problem Description
A Multiplication Game 1517 (博弈+规律)
A Multiplication Game Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4477 Accepted Submission(s): 2530 Problem Description Stan and Ollie