Sdut 2084 dota-The Battle of the People King (game theory)

Source: Internet
Author: User

dota-The Battle of the King. Time limit:1000ms Memory limit:65536k have questions? Dot here ^_^ The title describes the current DotA prevalence, I believe many students have been playing DotA all night experience, big treasure is no exception. Said Big treasure is known as the DotA big God, is rumored to be the Emperor Sky's apprentice, since the king, since the debut has not been a defeat. Of course, the fame of Da Bao brought him many challengers, but they were all escaped by the mask of the great treasure abuse. This day, big treasure ushered in a special challenger, carried out a special game, will there be a special outcome?

The challenger puts forward the rules of the game: Two men choose a hero to destroy the enemy tower. Assuming that there are N towers, two people take turns, each time can destroy up to M tower, at least 1 (in the destruction of [1, M] towers when the hero is invincible, but more than will be immediately killed! )。 When a man does not have a protective tower to destroy, he loses.Of course, the fame of the big treasure will certainly let the challenger start first. Do you think the myth that big treasure will remain undefeated today? Enter multiple sets of data to be processed to the end of the file. Each group of data has two values, N and M. (0 < M < N, n <= 2147483647) output if Da Bao can continue his unbeaten myth, output "Orz Dota God", otherwise output "A new Star Rise". Example input
5 32 1
Sample output
A new Star Riseorz Dota God
Hint Source von Sample program

#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include < String.h>using namespace Std;int Main () {    long long int n,m;    while (scanf ("%lld%lld", &n,&m)!=eof)    {        if (n% (m+1) = = 0)        {            printf ("Orz Dota god\n");        }        else        {            printf ("A new Star rise\n");        }    }    


Sdut 2084 dota-The Battle of the People King (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.