#include<bits/stdc++.h>
using namespace std;
const int inf=0x3f3f3f3f;
const int maxn=4e5+1;
int f[10];
int vis[maxn],path[maxn],path2[maxn];
void init(){
f[0]=1;
for(int i=1;i<=9;i++) f[i]=f[i-1]*i;
}
int kt(string s){
//康托
int res=0;
int len=s.length();
int cmp;
for(int i=0;i<len-1;i++){
cmp=0;
for(int j=i+1;j<len;j++){
if(s[i]>s[j]) cmp++;
}
res+=cmp*f[len-i-1];
}
return res;
}
void bfs(){
memset(vis,0
07-16
07-16
07-16
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交