2012年10月12日
摘要: 大意:八数码问题的变形,让你求离当前状态最远的距离。思路:BFS + hash判重,直到不能扩展为止,最后一个节点一定是最远的距离(由BFS性质知道)CODE:#include<iostream>#include<cstdlib>#include<cstdio>#include<cstring>#include<queue>#include<set>usingnamespacestd;typedefintState[9];constintMAXN=1000003;constintdx[]={-1,1,0,0};consti 阅读全文
posted @ 2012-10-12 21:38 有间博客 阅读(271) 评论(0) 推荐(0) 编辑