HDU 1564 play a game (game & search Rules)

Source: Internet
Author: User
Play a game

Time Limit: 1000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 1430 accepted submission (s): 1168


Problem descriptionnew year is coming!
Ailyanlu is very happy today! And he is playing a chessboard game With 8600.
The size of the chessboard is N * n. A stone is placed in a corner square. they play alternatively With 8600 having the first move. each time, player is allowed to move the stone to an unvisited neighbor square horizontally or vertically. the one who can't make a move will lose the game. if both play perfectly, who will win the game?

 

Inputthe input is a sequence of positive integers each in a separate line.
The integers are between 1 and 10000, inclusive, (means 1 <= n <= 10000) indicating the size of the chessboard. The end of the input is indicated by a zero.

 

Outputoutput the winner ("8600" or "ailyanlu") for each input line handle t the last zero.
No other characters shoshould be inserted in the output.

 

Sample input20

 

Sample output8600

 

Authorailyanlu

 

Sourcehappy 2007

 

Recommend8600 | we have carefully selected several similar problems for you: 1404 1536 1517 1524 the regular expression is that if it is an odd number, it will be used to win the game. If it is an even number, it is assumed that you want to search =
 1 #include<cstdio> 2 #include<cstring> 3 #include<stdlib.h> 4 #include<algorithm> 5 using namespace std; 6 int main() 7 { 8     int n; 9     while(scanf("%d",&n)&&n)10     {11         if(n%2==0)12             printf("8600\n");13         else14             printf("ailyanlu\n");15     }16     return 0;17 }
View code

 

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.