Description:
This matrix is given, and the original A array is obtained.
2-SAT questions: run one side for each digit and 31 for each digit.
Edge Creation
Note n = 1 and check whether the symmetric elements are the same.
# include # include # include # include # include # include # define Pb push_back # include using namespace STD; int V; const int max_v = 1111; vector G [max_v]; vector RG [max_v]; vector vs; bool used [max_v]; int CMP [max_v]; void add_edge (int from, int) {// cout " = 0; I --) if (! Used [vs [I]) RDFS (vs [I], K ++); For (INT I = 0; I now) & 1; if (I & 1) & (J & 1 )) {If (Num) {add_edge (I + N, J); add_edge (J + N, I);} else {add_edge (I, I + n); add_edge (J, J + n) ;}} else if (! (I & 1 )&&! (J & 1) {If (Num) {add_edge (I + N, I); add_edge (J + N, J);} else {add_edge (I, J + n); add_edge (J, I + n) ;}} else {If (Num) {add_edge (I, j + n); add_edge (J + N, i); add_edge (I + N, J); add_edge (J, I + n);} else {add_edge (I, j); add_edge (J, I ); add_edge (I + N, J + n); add_edge (J + N, I + n) ;}}for (INT I = 0; I <2 * N; I ++) for (Int J = 0; j % d \ n", I, G [I] [J]); SCC (); for (INT I = 0; I
hdu4421 bit magic [2-Sat]