[Noip simulation questions] Calendar games (game theory + SEARCH)

Source: Internet
Author: User

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)

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.