06 2015 档案

 
HDU 1237
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1237表达式计算,方法是中缀转后缀,再计算。中间处理用栈操作讲解看http://blog.csdn.net/antineutrino/article/details/6763722这题是简易版本的,不用处理括号#i... 阅读全文
posted @ 2015-06-19 21:31 LegendaryAC 阅读(259) 评论(0) 推荐(0)
HDU 4771
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4771给一个地图,@是起点,给一些物品坐标,问取完所有物品的最小步数,不能取完输出-1物品数最多只有四个,状态压缩一下bfs即可#include #include #include #include #inclu... 阅读全文
posted @ 2015-06-18 23:31 LegendaryAC 阅读(309) 评论(0) 推荐(0)
POJ 2976
摘要:http://poj.org/problem?id=297601分数规划问题,可以舍掉k组01分数规划用于解决的经典问题是最优比率生成树解法见http://www.cnblogs.com/lotus3x/archive/2009/03/21/1418480.html#include #includ... 阅读全文
posted @ 2015-06-18 19:34 LegendaryAC 阅读(210) 评论(0) 推荐(0)
HDU 1839
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1839题意:从1到n,要求时间小于等于T到达。每条边有一个容量,问最多能运多少货物。分析:最多能运的货物取决于路径上边的最小容量,所以二分容量,再用最短路判断时限即可。最短路里面多加一个判断保证走的边都能满足当前容... 阅读全文
posted @ 2015-06-16 17:12 LegendaryAC 阅读(250) 评论(0) 推荐(0)
HDU 5015
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=5015矩阵是表示状态转移的利器这题m很大,n非常小,所以开始的思考角度是能否从当前列推出下一列。有了这个角度,矩阵构造是很简单的#include #include #include using namespace ... 阅读全文
posted @ 2015-06-16 16:29 LegendaryAC 阅读(360) 评论(0) 推荐(0)
HDU 3006
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3006注意到集合内数字最大只有14,状态压缩一下,然后枚举出所有状态#include #include #include using namespace std;int dp[1<<15];int main() {... 阅读全文
posted @ 2015-06-15 23:04 LegendaryAC 阅读(151) 评论(0) 推荐(0)
HDU 2276
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2276矩阵乘法可以解决的一类灯泡开关问题/*转移关系为 now left now*1 0 1 1 1 00 1 10 0 0可知F[i] = (f[i] + f[(n... 阅读全文
posted @ 2015-06-15 18:11 LegendaryAC 阅读(260) 评论(0) 推荐(0)
HDU 2254
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2254矩阵乘法两个经典问题的综合题,还要离散化和处理边界,好题啊好题题意容易理解错,每一天是独立的,所以根据加法原理方案数是G^1+G^2+...+G^t/*此题要求 (G^1+G^2+...+G^t2)-(G^1... 阅读全文
posted @ 2015-06-15 14:21 LegendaryAC 阅读(178) 评论(0) 推荐(0)
HDU 1536 & 1944
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1536http://acm.hdu.edu.cn/showproblem.php?pid=1944一样的题题意:先给一个集合,代表可能发生的转移。然后m个询问,可以理解为每次给l堆石子,每堆有hi个,问博弈策略直接... 阅读全文
posted @ 2015-06-10 23:55 LegendaryAC 阅读(169) 评论(0) 推荐(0)
HDU 1538
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1538经典经济学问题,海盗分金分析http://www.guokr.com/article/41423/#include #include using namespace std;int a[15];int mai... 阅读全文
posted @ 2015-06-09 00:11 LegendaryAC 阅读(208) 评论(0) 推荐(1)
HDU 2177
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2177威佐夫博奕,面对奇异局势既bk=ak+k时是必败点,其中bk>=ak,k=bk-ak别的处理和其他博弈相同,注意题目的数据取一堆的时候数据有问题#include #include #include #incl... 阅读全文
posted @ 2015-06-07 10:40 LegendaryAC 阅读(174) 评论(0) 推荐(0)
HDU 2176
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2176nim博弈的模型。要输出先手第一次取的情况,考虑角度是留给对手必败态#include #include using namespace std;int a[200005];int main() { in... 阅读全文
posted @ 2015-06-02 22:43 LegendaryAC 阅读(133) 评论(0) 推荐(0)