HDU1079 Calendar Game

I only understand it after reading the blog written by the boss, but I have to read the blog of the boss for a long time to understand it, and I need to read the blog that I understand in seconds, so I wrote this blog in the hope that it can help Konjac like me =_= =_=

According to the parity, the target date November 4th is odd, then the even date must be a must win!

Here's an explanation of why even dates win:

1. The current date is even, my next step must be to find an odd date for another person, from winning to losing.

2. As a second-hand odd number, can you also find an odd number for the first-hand? That is the change from odd to odd! The answer is yes.

I didn't expect that there are such dates, September 30th to October 1st and November 30th to December 1st, yes, these two

You may be thinking of my previous conclusion: Even-numbered dates are sure to win! There are loopholes, no no no, if I was the first, I would not give you these two dates that can be from odd to odd.

When will September 30th appear: that is September 29th and August 30th, when September 29th I will give you October 29th, and August 30th I will give you August 31st,

In the same way, it can be explained that on November 30th, don't think about it, hahahaha, so the year of the monkey, the month of the monkey, and the month of the next month are odd numbers! This also shows that the first even number will win!

Is there any chance of winning with an odd number first? Isn't it the two dates from odd number to odd number mentioned above! This wave of foreshadowing is really 6!

 1 #include <iostream>
 2 #include <cstdio>
 3 using namespace std;
 4 int year,month,day;
 5 int main()
 6 {
 7     int t;
 8     scanf("%d",&t);
 9     while(t--)
10     {
11         scanf("%d%d%d",&year,&month,&day);
12         if((month+day)%2==0||(month==9&&day==30)||(month==11&&day==30))
13             printf("YES\n");
14         else
15             printf("NO\n");
16     }
17     return 0;
18 }

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324911848&siteId=291194637