alwaysBeAStarter

博客园 首页 新随笔 联系 订阅 管理

2017年6月29日 #

摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1507 MisereNim博弈。代码如下: 阅读全文
posted @ 2017-06-29 17:54 alwaysBeAStarter 阅读(94) 评论(0) 推荐(0) 编辑

摘要: 题目链接:http://poj.org/problem?id=2975 Nim游戏。代码如下: 阅读全文
posted @ 2017-06-29 16:51 alwaysBeAStarter 阅读(74) 评论(0) 推荐(0) 编辑

摘要: 题目链接:http://poj.org/problem?id=2234 Nim博弈游戏。代码如下: 阅读全文
posted @ 2017-06-29 16:49 alwaysBeAStarter 阅读(83) 评论(0) 推荐(0) 编辑

2017年6月28日 #

摘要: 题目链接:http://poj.org/problem?id=1067 威佐夫博弈 (Wythoff game): 当两堆石子的数量符合特定关系时,先行者必赢。两堆石子分别有a,b个石子时(a<=b), floor( (b-a) * ( (sqrt(5)+1) /2 ) ) == a 时,先行者必输 阅读全文
posted @ 2017-06-28 23:32 alwaysBeAStarter 阅读(110) 评论(0) 推荐(0) 编辑

2017年6月27日 #

摘要: 题目链接:http://poj.org/problem?id=2368 Bash game (巴什博弈):当K是(L+1)的倍数时可以确保second player赢。所以这道题要找的就是在K的因子中有没有大于2的因子。代码如下: 阅读全文
posted @ 2017-06-27 00:32 alwaysBeAStarter 阅读(102) 评论(0) 推荐(0) 编辑

2017年6月26日 #

摘要: 题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=291 cross product: for 2 vectors a and b, 阅读全文
posted @ 2017-06-26 16:50 alwaysBeAStarter 阅读(131) 评论(0) 推荐(0) 编辑

摘要: 题目链接:http://poj.org/problem?id=1678 动态博弈。用dp[i]来表示如果先行者首先选择第i个数字的话能取得的最大差值。由于每次选择的数字一定比上一次选择的数字大,所以先对数组进行排序。然后对于每个数字,如果先行者首先选择这个数字的话,dp[i] 初始化的值为num[i 阅读全文
posted @ 2017-06-26 16:25 alwaysBeAStarter 阅读(149) 评论(0) 推荐(0) 编辑

2017年6月23日 #

摘要: 题目链接:http://poj.org/problem?id=2411 状态压缩Dynamic Programming. For each row, at ith position, 1 means that there is a block placed at this row and next 阅读全文
posted @ 2017-06-23 21:45 alwaysBeAStarter 阅读(82) 评论(0) 推荐(0) 编辑

摘要: 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=44 Dynamic Programming. 对所有可能存在的长方形计算s 阅读全文
posted @ 2017-06-23 00:50 alwaysBeAStarter 阅读(82) 评论(0) 推荐(0) 编辑

2017年6月22日 #

摘要: 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1885 Dynamic Programming. dp[i][j]表示以 阅读全文
posted @ 2017-06-22 22:17 alwaysBeAStarter 阅读(101) 评论(0) 推荐(0) 编辑