【BZOJ 2437】[NOI2011] 兔兔与蛋蛋

相关链接

题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2437
神犇题解:http://blog.csdn.net/qpswwww/article/details/45368587

解题报告

我们先将整个棋盘黑白染色,将空格棋子所在方格的颜色分类
在可相互转化的状态之间连边,那么这就是一张二分图了

那么原题的问题转换为:

给定一张二分图,每次沿边移动一次
每个点只能到达一次,最后谁不能动谁就输了
询问每一个点作为起点时是否先手必胜

考虑一个点如果在任意一种最大匹配当中,那么先手每一次走匹配边,则后手必败
换一句话来说,如果一个点一定在最大匹配当中,那么这个点是先手必胜的
再考虑一下,如果一个点不一定在最大匹配当中,那么删掉这个点之后存在最大匹配,那后手走到那个点去就可以了!
再换一句话来说,如果一个点不一定在最大匹配中,那么这个点先手必败

现在我们只需要求出一个点是否在最大匹配中就可以了!
我们可以枚举这个点,将其删掉后跑最大匹配验证,但复杂度是$O(n^4)$的
或者我们可以用今年冬令营的那个一般图匹配的算法来做,时间复杂度是$O(n^3)$的

不过我们可以又一个常数更小的算法

我们可以先求出一个最大匹配,然后假设当点在点$a$
将其删掉后,看$a$的匹配点$b$还能不能匹配即可

吐槽

博弈题居然还能这么玩!
真的是长见识了 _(:з」∠)_
不过代码好难写啊,不想写代码 ┑( ̄Д  ̄)┍

224 thoughts to “【BZOJ 2437】[NOI2011] 兔兔与蛋蛋”

  1. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!

  2. Good post and right to the point. I don’t know if this is truly the best place to ask but do you guys have any thoughts on where to get some professional writers? Thx 🙂

  3. I have been exploring for a little bit for any high quality articles or weblog posts on this sort of area . Exploring in Yahoo I eventually stumbled upon this web site. Studying this info So i am satisfied to show that I’ve a very good uncanny feeling I found out exactly what I needed. I such a lot without a doubt will make certain to don?t forget this web site and provides it a glance regularly.|

  4. Thank you for every other informative blog. Where else could I am getting that type of info written in such a perfect manner? I have a undertaking that I am just now running on, and I’ve been at the look out for such information.|

  5. You really make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complicated and very broad for me. I am looking forward for your next post, I will try to get the hang of it!|

  6. We stumbled over here from a different website and thought I may as well check things out. I like what I see so now i am following you. Look forward to looking at your web page yet again.|

  7. I like the valuable info you provide on your articles. I’ll bookmark your blog and take a look at once more right here regularly. I am reasonably certain I’ll be told a lot of new stuff right here! Good luck for the following!|

  8. Greetings from Los angeles! I’m bored to death at work so I decided to check out your blog on my iphone during lunch break. I love the information you present here and can’t wait to take a look when I get home. I’m surprised at how fast your blog loaded on my cell phone .. I’m not even using WIFI, just 3G .. Anyhow, awesome blog!|

Leave a Reply

Your email address will not be published. Required fields are marked *