Home > Back-end >  About confusion, netease written in a programming algorithm for each great god give directions
About confusion, netease written in a programming algorithm for each great god give directions

Time:09-22



The process is made of violence enumeration
 # include & lt; Bits/stdc++. H> 

using namespace std;

Vector a;
int n;
Int b [10].
Int ret.
Void DFS (int I) {
If (I==a.s considering ()) {
Ret++;
} else {
For (int j=0; J & lt; A [I]. The size (); J++) {
If (b [a [I] [j] - '0']) {
B [a [I] [j] - '0')=0.
DFS (I + 1);
B [a [I] [j] - '0']=1;
}
}
}
}
Int main () {
Cin & gt;> n;
for(int i=0; i String x; Cin & gt;> x;
Amy polumbo ush_back (x);
}
for(int i=0; i <10; [I] i++) b=1;
Ret=0;
DFS (0);
cout return 0;
}


The building Lord stupid, drew a sketch for half a day is not very understand the thinking of it, or have other ideas welcome pointed out
  • Related