POJ1704 Georgia and Bob (阶梯博弈)】的更多相关文章

Georgia and Bob Time Limit: 1000MS   Memory Limit: 10000KB   64bit IO Format: %I64d & %I64u Submit Status Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2,…
Georgia and Bob Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9363   Accepted: 3055 Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ...…
Georgia and Bob Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 14312   Accepted: 4840 Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ..…
参考博客 先讲一下Georgia and Bob: 题意: 给你一排球的位置(全部在x轴上操作),你要把他们都移动到0位置,每次至少走一步且不能超过他前面(下标小)的那个球,谁不能操作谁就输了 题解: 当n为偶数的时候,假设当每个球都相互挨着没有间隙,那么两两一组,一组中前面那个走到哪,后面那个跟上就可以了,先手必输 如果球与球之间有间隙,那么俩俩球之间的距离可以当作尼姆博弈中取石子游戏中一堆石子的石子数,用尼姆博弈判断一下就可以了 可以说先手赢不赢光和两球之间的距离有关,如果俩俩球之间的的距离…
http://poj.org/problem?id=1704 我并不知道阶梯博弈是什么玩意儿,但是这道题的所有题解博客都写了这个标签,所以我也写了,百度了一下,大概是一种和这道题类似的能转换为尼姆博弈的博弈. 解法大概是配对之后的尼姆博弈,没看到一个格子只能放一个石头(以为可以直接把石头移动到前一个石头在的格子),所以莫名其妙wa了orz,总是因为题目被踩爆orz 其实博弈也是个很神奇的东西,现在这个东西给我的印象又变成配对找规律了(泪),虽然看上去从后往前两两配对的做法很有道理但是迫切需要更数…
Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11357   Accepted: 3749 Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ..., and place N c…
阶梯博弈的变形.不知道的话还是一道挺神的题. 将所有的棋子两两绑在一起,对于奇数个棋子的情况,将其与起点看作一组.于是便可以将一组棋子的中间格子数看作一推石子.对靠右棋子的操作是取石子,而对左棋子的操作并不会对游戏造成影响,考虑如果在 NIM 博弈时有增加石子的操作,那么下一步另一个人就可以去相同数量的石子,于是局面并没有改变. 然后就来一发异或和就行了. #include <bits/stdc++.h> using namespace std; int n,a[10005]; int mai…
Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9771   Accepted: 3220 Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on paper, number the grids from left to right by 1, 2, 3, ..., and place N ch…
从这开始我们来进入做题环节!作为一个较为抽象的知识点,博弈论一定要结合题目才更显魅力.今天,我主要介绍一些经典的题目,重点是去理解模型的转化,sg函数的推理和证明.话不多说,现在开始! Georgia and Bob Time Limit: 1000MS   Memory Limit: 10000K       Description Georgia and Bob decide to play a self-invented game. They draw a row of grids on…
题意: 每次可以向左移动一个棋子任意步,不能跨过棋子 很巧妙的转化,把棋子间的空隙看成石子堆 然后裸阶梯Nim #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; ; inline int read(){ ,f=; ;c=ge…