能力值:
( LV12,RANK:306 )
|
-
-
2 楼
const int st[16]={20,34,30,16,56,48,24,16,4,26,36,8,2,38,56,42}; const int u[16][3]={ {0,1,2}, {3,4,0}, {5,6,0}, {5,7,1}, {4,6,1}, {8,2,3}, {9,2,4}, {7,10,3}, {8,12,5}, {11,13,6}, {12,13,7}, {11,14,9}, {14,8,10}, {15,9,10}, {15,11,12}, {15,13,14} }; const int n=64,m=16,v=3;
char o[64][64][64]; int lst[16],s[16],t[16],l[16],p[16];
inline bool dfs(int x) { //out,"dfs:",x,'\n'; if(x>1&&p[x-1]!=p[x-2]) { fo(j,p[x-2],p[x-1]-1) if(o[t[u[j][0]]][t[u[j][1]]][t[u[j][2]]]!=s[j])return 0; } if(x==m) { out,"ok\n"; return 1; } fo0(i,n) { t[x]=i; if(dfs(x+1))return 1; } return 0; }
int main() { freopen("in.txt","r",stdin); fread(o,1,sizeof(o),stdin); fo0(i,n)fo0(j,n)fo0(k,n)assert(o[i][j][k]<n); fo0(i,m)s[i]=st[i]; fo0(i,m) { l[i]=max(u[i][0],max(u[i][1],u[i][2])); if(i)repr(l[i],l[i-1]); } fo0(i,m)p[l[i]]=i+1; fo1(i,m-1)repr(p[i],p[i-1]); fo0(i,m)out,p[i],' ';out,'\n'; //fo0(i,m)t[i]=rand()%64; //fo0(j,m)s[j]=o[t[u[j][0]]][t[u[j][1]]][t[u[j][2]]]; fo0(i,m)out,s[i],' ';out,'\n'; fo0(i,20) { out,i,"==========================\n"; dfs(0); fo0(j,m)out,t[j],' ';out,'\n'; fo0(j,m)assert(s[j]==o[t[u[j][0]]][t[u[j][1]]][t[u[j][2]]]); fo0(j,m)s[j]=t[j]; } while(1); }
|