搜索
文章平均质量分 81
代金桥
交流邮箱daijinqiao(at)163.com
展开
-
poj 1655 Balancing Act
类型:DFS 来源:POJ Monthly--2004.05.15 IOI 2003 sample task 题目:一棵树,定义每个节点的balance值:去掉这点节点后的森林里所有树的最大节点数。求出最小的balance值和其所对应的节点编号 思路:通过邻接表构造以1为根的二叉树,对其进行dfs,对于待删除节点u,其balance值为各个以u为根的子树的节点数的最大值或者除该树(u为根原创 2012-03-06 12:59:55 · 206 阅读 · 0 评论 -
ZOJ 2110 Tempter of the Bone
类型:搜索[DFS] 题目:给定迷宫,判断是否能够刚好用T步到达目标格点 来源:Zhejiang Provincial Programming Contest 2004 思路:dfs + 剪枝,当达到目标时,做标记并退出,当未达到目标且当前位置为门时退出 // ZOJ 2110 Tempter of the Bone // tle ac 1550ms 188kb #include #in原创 2012-03-18 10:42:40 · 287 阅读 · 0 评论 -
hdoj 4198 Quick out of the Harbour
类型:bfs + 优先队列 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4198 来源:BAPC 2011 思路:扩展完当前节点后,将"路径"小的节点出队,进行扩展。 !!!S点可能在边上 // hdoj 4198 Quick out of the Harbour // wa ac 125MS 764K #include #include原创 2012-04-10 11:40:24 · 401 阅读 · 0 评论