Fliping game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 46 Accepted Submission(s): 35 Problem Description Alice and Bob are playing a kind of special game on an N*M board (N rows, M colu…
Fliping game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 307 Accepted Submission(s): 220 Problem Description Alice and Bob are playing a kind of special game on an N*M board (N rows, M co…
题意: 给一个01矩阵,每次可以选择1的格子,选择之后以他为左上角的矩阵全都取反,两个人轮班取,不能取的人输. 思路: 博弈的题目,结论是右下角是0就输,1就赢,原因可以这么想 无论那次操作都会改变右下角的那个格子,如果是1的话就能保证每次改完都是0,而对方改完都是1,这样只要对方操作,那么就会把最后一个变成1,你最坏的情况可以操作右下角的这个1,直到对方无法操作为止. #include<stdio.h> int main () { int t ,n ,m ,i ,j…
链接:http://acm.hdu.edu.cn/ 两个人进行翻棋游戏,若a[n][m]为1,则不管先手就可以翻a[n][m]使其为0,这样不管后手翻什么都会使得a[n][m]为1,先手总是有棋可翻:而若a[n][m]为0,先手 总会面临无棋可翻的状态,因此只需要判断a[n][m]的值即可求解 #include<iostream> #include<cstdio> using namespace std; const int maxn=100+10; int a[maxn][max…
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2145 Accepted Submission(s): 1622 Problem Description 大学时光是浪漫的,女生是浪漫的,圣诞更是浪漫的,但是Rabbit和Grass这两个大学女生在今年的圣诞节却表现得一点都不浪漫:不去逛商场,不去逛…
Life Winner Bo Problem Description Bo is a "Life Winner".He likes playing chessboard games with his girlfriend G. The size of the chessboard is N×M.The top left corner is numbered(1,1) and the lower right corner is numberd (N,M). For each game…
先转一篇看得比较懂的,以后有时间自己再归纳下 转自:http://blog.csdn.net/logic_nut/article/details/4711489 博弈问题若你想仔细学习博弈论,我强烈推荐加利福尼亚大学的Thomas S. Ferguson教授精心撰写并免费提供的这份教材,它使我受益太多.(如果你的英文水平不足以阅读它,我只能说,恐怕你还没到需要看"博弈论"的时候.)Nim游戏是博弈论中最经典的模型(之一?),它又有着十分简单的规则和无比优美的结论,由这个游戏开始了解博弈…
Rabbit and Grass Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3864 Accepted Submission(s): 2919 Problem Description 大学时光是浪漫的,女生是浪漫的,圣诞更是浪漫的,但是Rabbit和Grass这两个大学女生在今年的圣诞节却表现得一点都不浪漫:不去逛商场,不去逛…