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 ;}