POJ2505 A multiplication game[game theory]

Source: Internet
Author: User

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]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.