diff --git a/3-B-1/README.md b/3-B-1/README.md new file mode 100644 index 0000000..ea9e5ac --- /dev/null +++ b/3-B-1/README.md @@ -0,0 +1,5 @@ +# 八皇后 + +[P1219](https://www.luogu.com.cn/problem/P1219) + +[code](https://www.luogu.com.cn/record/138423182) diff --git a/3-B-1/main.cpp b/3-B-1/main.cpp new file mode 100644 index 0000000..4af2381 --- /dev/null +++ b/3-B-1/main.cpp @@ -0,0 +1,43 @@ +#include + +using namespace std; + +int xie[26], nxie[26]; +int wei[13], h[13]; +int sum; + +void dfs(int d, int n) +{ + if (d == n) + { + sum++; + if (sum <= 3) + { + for (int i = 0; i < n; i++) + { + cout << wei[i]+1 << ' '; + } + cout << endl; + } + } + + for (int i=0;i> n; + dfs(0, n); + cout << sum; + return 0; +}