//位压缩加搜索枚举,用pre记录其前驱#include#include #define N 100000struct node{ int x,y,num,pre,step;}p[N*4];struct nn{ int x,y;}g[N*4];char str[10][10];int vis[N];int d[16]={ 0xf888,0xf444,0xf222,0xf111, 0x8f88,0x4f44,0x2f22,0x1f11, 0x88f8,0x44f4,0x22f2,0x11f1, 0x888f,0x444f,0x222f,0x111f,};int bfs(int sum){ int head=0,tail=0,i; p[head].num=sum; p[head].step=0; p[head].pre=0; tail++; while(head =0;i--) { printf("%d %d\n",g[i].x+1,g[i].y+1); }}