YunYan

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2019年7月30日

摘要: 用bfs遍历最图求最短路径时通常借用优先队列即优先考虑最大的或者最小的权值 方法1 优先队列:(内置函数,优先考虑较小的权值) 方法2:队列加判断条件(开一个数组step,加一个判断条件step [ d x ] [ d y ] > step [x] [y] + mp [dx] [dy] ) 阅读全文
posted @ 2019-07-30 22:40 Target--fly 阅读(1260) 评论(0) 推荐(0)

摘要: LL最近沉迷于AC不能自拔,每天寝室、机房两点一线。由于长时间坐在电脑边,缺乏运动。他决定充分利用每次从寝室到机房的时间,在校园里散散步。整个HDU校园呈方形布局,可划分为n*n个小方格,代表各个区域。例如LL居住的18号宿舍位于校园的西北角,即方格(1,1)代表的地方,而机房所在的第三实验楼处于东 阅读全文
posted @ 2019-07-30 20:43 Target--fly 阅读(138) 评论(0) 推荐(0)

摘要: The king has guards of all different heights. Rather than line them up in increasing or decreasing height order, he wants to line them up so each guar 阅读全文
posted @ 2019-07-30 19:29 Target--fly 阅读(162) 评论(0) 推荐(0)

摘要: Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The first two s 阅读全文
posted @ 2019-07-30 16:41 Target--fly 阅读(153) 评论(0) 推荐(0)

摘要: 1.记忆化搜索的思想 记忆化搜索的思想是,在搜索过程中,会有很多重复计算,如果我们能记录一些状态的答案,就可以减少重复搜索量 2、记忆化搜索的适用范围 根据记忆化搜索的思想,它是解决重复计算,而不是重复生成,也就是说,这些搜索必须是在搜索扩展路径的过程中分步计算的题目,也就是“搜索答案与路径相关”的 阅读全文
posted @ 2019-07-30 13:48 Target--fly 阅读(293) 评论(0) 推荐(0)