摘要: 学了一下怎么写递归,发现确实比较简单;dp[pos][][]对应dfs()中的参数的状态,记忆化当前状态的值,不用考虑这个状态表示什么意思;然后就是设计好dfs()中的参数;hdu 3555http://acm.hdu.edu.cn/showproblem.php?pid=3555题意:统计1~n之间含有49的数字的个数;需要记录当前位置,前一位置放了那个数字,当前是否已经包含49,是否有上界;dfs(pos,pre,istrue,limit); 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace . 阅读全文
posted @ 2013-11-11 20:19 Rabbit_hair 阅读(5664) 评论(0) 推荐(2) 编辑