随笔分类 -  记忆化搜索

摘要:题目链接:http://codeforces.com/contest/283/problem/B思路: dp[now][flag]表示现在在位置now,flag表示是接下来要做的步骤,然后根据题意记忆化搜索记忆,vis数组标记那些已经访问过的状态。#include #include #include... 阅读全文
posted @ 2014-05-29 17:01 ihge2k 阅读(159) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4826思路:dp[x][y][d]表示从方向到达点(x,y)所能得到的最大值,然后就是记忆化了。#include #include #include #include #define REP(i, a, ... 阅读全文
posted @ 2014-05-27 22:17 ihge2k 阅读(186) 评论(0) 推荐(0)