代码 struct DLX { int n,id; int L[maxn],R[maxn],U[maxn],D[maxn]; ]; ) //传列长 { n=nn; ;i<=n;i++) U[i]=D[i]=i,L[i]=i-,R[i]=i+; L[]=n; R[n]=; id=n; memset(S,,sizeof(S)); } void AddRow(int x,int col,int A[]) //传入参数是行标号,列长,列数组 { bool has=false; ; ;y<=col;y+…