http://acm.fafu.edu.cn/problem.php?id=1410
类似八数码问题 用整形存状态4秒 康拓展开式1秒
#include<stdio.h>
#include<string.h>
#include<queue>
#include<vector>
#include<map>
using namespace std;
const int maxn = 1005;
const int inf = 1<<30;
int n;
int f[10];
int mod[] = {1,10,100,1000,10000,100000,1000000,10000000,100000000};
struct Node
{
char s[10];
int step;
}node[400000];
char input()
{
char ch;
while(ch = getchar(), ch == '\n' || ch == ' ');
if( ch == EOF ) return EOF;
return ch;
}
void getf()
{
f[0] = 0; f[1] = 1;
for( int i = 2; i <= 9; i ++ )
f[i] = f[i-1] * i;
}
int kt(char s[],int n)//n表示该排列有n个数
{
int sum = 0;
for(int i = 1; i <= n; i++)
{
in