随笔分类 -  博弈论

P3235 [HNOI2014]江南乐 (整数分块+sg)
摘要:P3235 [HNOI2014]江南乐 https://www.luogu.com.cn/problem/P3235 题目描述 小A是一个名副其实的狂热的回合制游戏玩家。在获得了许多回合制游戏的世界级奖项之后,小A有一天突然想起了他小时候在江南玩过的一个回合制游戏。 游戏的规则是这样的,首先给定一个 阅读全文

posted @ 2021-02-25 16:17 Aminers 阅读(76) 评论(0) 推荐(0)

CF Gym 102059I Game on Plane(sg函数)
摘要:You are given NN points on a plane. These points are precisely the set of vertices of some regular NN-gon. Koosaga, an extreme villain, is challenging 阅读全文

posted @ 2020-12-10 12:24 Aminers 阅读(132) 评论(0) 推荐(0)

poj 2425 A Chess Game (DAG上博弈)
摘要:http://poj.org/problem?id=2425(记录模板) 思路:dfs找对应起始位置的sg函数,看异或和是不是0。(具体看代码) 代码: #include<iostream> #include<algorithm> #include<cstring> #include<cstdio> 阅读全文

posted @ 2020-08-13 21:32 Aminers 阅读(144) 评论(0) 推荐(0)

poj 2975 Nim(博弈+异或和)
摘要:http://poj.org/problem?id=2975 题目描述: 有n堆石子,每次从一堆中拿石子,问是否是必胜,如果不是输出0,是就输出拿一次后依然是必胜的方法数。 思路: 由Nimm游戏可知,n堆石子异或和不为0的时候为必胜状态。所以我们要在其中一堆中拿若干个后让异或和为0。 首先对异或和 阅读全文

posted @ 2020-08-13 11:49 Aminers 阅读(218) 评论(0) 推荐(0)

导航