[poj2286]The Rotation Game (IDA*)】的更多相关文章

//第一次在新博客里发文章好紧张怎么办 //MD巨神早已在一个小时前做完了 The Rotation Game Time Limit: 15000MS Memory Limit: 150000K Total Submissions: 5950 Accepted: 1992 Description The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The b…
The Rotation Game Time Limit: 15000MS   Memory Limit: 150000K Total Submissions: 6325   Accepted: 2134 Description The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The blocks are marked with symbols 1, 2…
The Rotation Game Time Limit: 15000MS   Memory Limit: 150000K Total Submissions: 5691   Accepted: 1918 Description The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The blocks are marked with symbols 1, 2…
先是这周是搜索的题,网站:http://acm.hdu.edu.cn/webcontest/contest_show.php?cid=6041 主要内容是BFS,A*,IDA*,还有一道K短路的,.....木做,本来1009是说要用迭代加深做,但是我在他讲之前就用BFSA了,虽然很耗时,但还是过了,10000MS的时限,我8000+MS....... 1001 Eight  八数码问题 先把代码放上来 题目网址: http://acm.hdu.edu.cn/showproblem.php?pid…
Description The rotation game uses a # shaped board, which can hold 24 pieces of square blocks (see Fig.1). The blocks are marked with symbols 1, 2 and 3, with exactly 8 pieces of each kind. Initially, the blocks are placed on the board randomly. You…
状态搜索题目  一开始打算用bfs  但是图给的不是矩形图  有点难以下手 参考了 lrj    将图上所有的点进行标号  直接一个一维数组就解决了图的问题  并且明确了每个点的标号  处理起来十分方便   可见处理不规则图一定要标号解决   之前的万圣节的早晨也是进行标号处理 用IDA* 十分快 启发方程为  d+h()<maxx   显然一次变动最多只改变了中心的一个格子  最多使得 多一个数字填充完毕 很有价值的状态搜索题目 #include<bits/stdc++.h> usin…
题目大意: 给你一个“井”子状的board,对称的由24个方块组成,每个方块上有123三个数字中的一个.给你初始状态,共有八种变换方式,求字典序最小的最短的的变换路径使得,board中间的八个方块上数字相同.(建议看下题目中的图就懂啦). IDA*搜索. 我是干脆用结构体保存搜索状态(当然这样很占空间了,可能也耗时间,不过这题15s/150M的时空限制我也是醉了).保存一个board temp,一个搜索路径path,搜索深度n,以及一个内置的估值函数h().h()返回的是8减这八个方块上出现最多…
(再一次感谢学长幻灯片) ID A* 随便自己yy了一下. 额嗯 思路什么的都没有问题 就是改不对.. 无奈地删代码...边删边交. 删啊删 哎呦 AC了 ... ... ... 找删的那一段 . oh 原来 d[i]^1!=f 要改成(d[i]^1)!=f 优先级问题 无奈了.. #include<cstdio> #include<algorithm> using namespace std; char t,a[25],b[25],d[]={0,2,4,7,3,1,6,5},ch…
POJ2449 Remmarguts' Date UDF's capital consists of N stations. The hall is numbered S, while the station numbered T denotes prince' current place. M muddy directed sideways connect some of the stations. Remmarguts' path to welcome the princess might…
启发式搜索 启发式搜索是一种对搜索到的每一个位置进行评估,然后从评估的最优位置进行搜索直到目的地, 由于搜索时对每一个位置的评估是基于直观或经验的所有叫启发式搜索 A*算法 历史: 1964年Nils Nilsson提出了A1算法,是一个启发式搜索算法, 而后又被改进成为A2算法,直到1968年,被Peter E. Hart改进成为A*算法 主要思想: 1.对于每个搜索到的点求一个估价函数f(x). $\large f(x)=g(x)+h(x)$ 其中g(x)表示起点到当前点实际走的代价,h(x…