随笔分类 -  搜索专题

基础算法
摘要:1.关于BFS的Key_word: ①hash或状态压缩记录状态 ②状态剪枝 ③反向BFS ④双向BFS ⑤特殊初始化VIS数组 ⑥动态图的搜索 ⑦优先队列优化搜索 ⑧数位搜索 下面是一一讲解: 1.hash或状态压缩记录状态 : 当状态太多而且边界也广时数组难以存储状态时或者题目对空间的要求较为苛 阅读全文
posted @ 2019-08-26 23:46 风骨散人 阅读(318) 评论(0) 推荐(0) 编辑
摘要:In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, Given some of the numbers in the grid, your 阅读全文
posted @ 2019-08-12 11:34 风骨散人 阅读(268) 评论(0) 推荐(0) 编辑
摘要:Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignatius逃亡的好机会. 魔王住在一个城堡里,城堡是一个A*B*C的立方体,可以被表示成A个B*C的矩阵,刚开始Ignatius被关在(0,0,0)的位置,离开城堡的门在(A-1,B-1,C-1)的位置,现在知道魔王将在T分钟后回到城堡, 阅读全文
posted @ 2019-08-09 18:40 风骨散人 阅读(137) 评论(0) 推荐(0) 编辑
摘要:You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. 阅读全文
posted @ 2019-08-08 16:19 风骨散人 阅读(183) 评论(0) 推荐(0) 编辑
摘要:在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将 阅读全文
posted @ 2019-08-08 16:12 风骨散人 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numb 阅读全文
posted @ 2019-08-07 18:13 风骨散人 阅读(183) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示