A Multiplication Game
Time Limit: 1000MS |
|
Memory Limit: 65536K |
Total Submissions: 6028 |
|
Accepted: 3013 |
Description
Stan and Ollie play the game of multiplication by multiplying a integer p by one of the numbers 2 to 9. Stan always starts with P = 1, does he multiplication, then Ollie multiplies the number, then Stan and so on. Before a game starts, they draw an integer 1 < n < 4294967295 and the winner are who first reaches P >= N.
Input
Each line of input contains one integer number N.
Output
For each line of the input output one line either
Stan wins.
Or
Ollie wins.
Assuming that both of them play perfectly.
Sample Input
1621734012226
Sample Output
Stan wins. Ollie wins. Stan wins.
Source
Waterloo Local 2001.09.22 hand it over, please.0~9 Stan10~9*2 Ollie//2 is Stan, he wants to try to stop Ollie take N;9 is Ollie, he wants to be as big as possible to fetch n19~9*2*9 Stanetc.you can use N to keep/18 .
Note Double n
#include <cstdio>DoubleN;intMain () { while(SCANF ("%LF", &n)! =EOF) { while(n> -) n/= -; if(n<=9) puts ("Stan wins."); ElsePuts"Ollie wins."); }}
POJ2505 A multiplication game[game theory]