【博弈论】poj2484 A Funny Game】的更多相关文章

A Funny Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5401   Accepted: 3381 Description Alice and Bob decide to play a funny game. At the beginning of the game they pick n(1 <= n <= 106) coins in a circle, as Figure 1 shows. A mo…
如果当前状态可以根据某条轴线把硬币分成两个相同的组,则当前状态是必败态. 因为不论在其中一组我们采取任何策略,对方都可以采取相同的策略,如此循环,对方必然抽走最后一枚硬币. 因为我们先手,因此抽完后盘面变成了一个n-1或n-2长度的链,此时对方只需按照奇偶性把某个位置的硬币抽走,就可以让我们达到必败态. 因此,若n>2,先手必败,反之,先手必胜. #include<cstdio> using namespace std; int n; int main() { while(1) { sc…
背景: 昨天看了<最强大脑>,由于节目比较有争议性,不知为什么,作为一名感性的人,就想试一下如果自己理性分析会是怎样的呢? 过程是这样的: 中国队(3人)VS英国队(4人). 1:李建东(队长)出战,[并说中国队不胜就再不参加最强大脑]3局过后,打平,双方都没脑力进行下一轮,所以评委各得1分,结果:1V1. 2:苏XX(忘名了)出战,打败对手,结果:2V1. 3:申一帆出战,失败,结果2V2平(同时申一帆情绪失控离开节目现场,经节目组一番说辞后回归节目) 问题来了:最后一战,谁出站,在大屏幕播…
Euclid's Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9033   Accepted: 3695 Description Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser o…
Game Theory Reveals the Future of Deep Learning Carlos E. Perez Deep Learning Patterns, Methodology and Strategy @ IntuitionMachine.com 译自:https://medium.com/intuitionmachine/game-theory-maps-the-future-of-deep-learning-21e193b0e33a#.2vjbrl5di 若你一直fo…
一些比较水的博弈论...(为什么都没有用到那什么SG呢....) TYVJ 1140  飘飘乎居士拯救MM 题解: 歌德巴赫猜想 #include <cmath> #include <cstdio> int n, a, b, ta, tb; inline bool isPrime(int x){ ) return true; ; i<=sqrt(x); i++) if (!(x%i)) return false; return true; } inline int getTi…
C. The Game Of Parity time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n cities in Westeros. The i-th city is inhabited by ai people. Daenerys and Stannis play the following game:…
http://poj.org/problem?id=2234 博弈论真是博大精深orz 首先我们仔细分析很容易分析出来,当只有一堆的时候,先手必胜:两堆并且相同的时候,先手必败,反之必胜. 根据博弈论的知识(论文 张一飞:<由感性认识到理性认识——透析一类搏弈游戏的解答过程>) 局面可以分解,且结果可以合并. 局面均是先手 当子局面是 胜 和 败,那么局面则为胜 当子局面是 败 和 胜,那么局面则为胜 当子局面是 败 和 败,那么局面则为败 当子局面为 胜 和 胜,那么局面为不确定 而这些性质…
文章原地址:http://blog.csdn.net/zhangxiang0125/article/details/6174639 博弈论:是二人或多人在平等的对局中各自利用对方的策略变换自己的对抗策略,达到取胜目标的理论.博弈论是研究互动决策的理论.博弈可以分析自己与对手的利弊关系,从而确立自己在博弈中的优势,因此有不少博弈理论,可以帮助对弈者分析局势,从而采取相应策略,最终达到取胜的目的. 博弈论分类:(摘自百度百科) (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆…
思路:首先用Tarjan算法找出树中的环,环为奇数变为边,为偶数变为点. 之后用博弈论的知识:某点的SG值等于子节点+1后的异或和. 代码如下: #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<vector> #include<cstring> using namespace std; int ans; vector<…