Search directly...
Do not blow the stack .. Therefore, we can perform multipart search...
Then I'm too lazy and too weak to write...
Orz hzwer
[Problem description]
Mored and mored's pet cd are playing a calendar game, starting from January 1-20, 1900 to December 22 (you know ......) Select a date to start and follow one of the following rules to jump back to the date:
1. jump to the next day on the calendar.
2. Jump to the same day of the next month on the calendar (if it does not exist, you cannot do so ).
If anyone arrives on July 15, December 22, 2012, then he will win. If he arrives on the date after that, he will lose. You know the reason.
Mored goes first every time.
Now, give you a date. Will mored win?
[Input]
Enter a total of T rows. Each row has three integers, Y, M, and D, indicating year, month, and day. The date ranges from January 1, January 1-20, 1900 to January 1, December 22 (including the two ends ).
T is not in the input data.
[Output]
If mored is sure to win, output a line of yes; otherwise, output No.
[Example 1 of input and output]
Calendar. In |
Calendar. Out |
2012 12 20 |
No |
[Example 2 of input and output]
Calendar. In |
Calendar. Out |
2012 12 21 |
Yes |
[Data description]
For 50% of data, it is the date after January 1, January 1, 1949. T <= 5
For 100% of data, it is the date after January 1, January 1, 1900. T <= 10
[Noip simulation questions] Calendar games (game theory + SEARCH)