文章分类 -  记忆化搜索

摘要:1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <cstring> 5 #include <cstdlib> 6 #include <queue> 7 #include <string> 8 #i 阅读全文
posted @ 2017-02-01 10:13 KingSann 阅读(79) 评论(0) 推荐(0)
摘要:由于是无环图所以并不需要高斯消元什么的。。 f[i]:=i到n的期望 f[i]=Σf[j]+cost[i][j] (i,j∈G) f[n]=0 那么就是需要求f[1],将图反向后bfs一遍就行。(dfs的话会爆栈。。) 1 #include <iostream> 2 #include <algori 阅读全文
posted @ 2017-01-23 16:35 KingSann 阅读(148) 评论(0) 推荐(0)
摘要:瞬间脑补出某到经典的记忆化搜索。。然后觉得应该没那么简单。。 然而。。——“Q、S、B操作总数≤100” ???真的是大暴力啊。。 于是就暴力吧。。。 1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #inclu 阅读全文
posted @ 2017-01-20 20:33 KingSann 阅读(132) 评论(0) 推荐(0)