Hdu 2147 kiki & amp; #39; s game, basic getting started game

Source: Internet
Author: User

Hdu 2147 kiki & #39; s game, basic getting started game
Game concepts:
Point to defeat: the Previous player called the winning position a point to defeat.

Winning point (N): The Next player calls the winning position a winning point.


Defeat (WIN) Point attribute
(1) All endpoints are mandatory (point P );
(2) from any winning point (N points), there is at least one way to enter the point (P point );
(3) No matter how you operate, you can only enter the point of victory (N) from the point of defeat (point of P ).


Hdu 2147 kiki's game

Question:
In an m * n board, starting from (1, m), you can move one to the left, one to the left, and one to the left. Then kiki goes first, and judges that kiki will win (when the other party has no way to go ).

We can introduce P and N states as follows:



# Include

 
  
# Includeusing namespace std; int main () {int a, B; while (scanf ("% d", & a, & B )) {if (a = 0 & B = 0) break; if (a % 2 = 0 | B % 2 = 0) printf ("Wonderful! \ N "); else printf (" What a pity! \ N ") ;}return 0 ;}

 


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.