#include #include int q[14]; int sol[3][14]; int r = 0, d1 = 0, d2 = 0; int solP = 0; int n; void gen_sol(int col) { if (col == n) { if (solP < 3) memcpy(sol[solP], q, sizeof(int) * n); ++solP; return; } //NOTE Just calculating the non-admisible rows for this col every time is slightly faster than the "keep track of used rows and diagonals" solution // int oc = 0; // for (int i(0); i < col; ++i) { // oc |= 1< 6)) solP += temp; printf("%d\n", solP); return 0; }