[BZOJ1299] chocolate bar (game theory)

Source: Internet
Author: User

Title: http://hzwer.com/1976.html

Analysis: First Orz Hzwer

For the chocolate bar outside the box is the NIM game.

So it's easy to think of the first step. It's best to remove the M-root chocolate bar from the box, making the chocolate bar different or 0, and the rest of the chocolate bar in the box can not be obtained by any means or 0 (actually M is the longest xor or 0 subsequence of all chocolate bars)

So for the back, whether it is to eat outside the box, or take the inside of the box, will be defeated

So the initiator wins when and only if there is M, which makes M chocolate bar XOR 0

[BZOJ1299] chocolate bar (game theory)

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.