摘要:
组合型枚举,注意选满k个而不是n个即可回溯 const int N=25; int a[N]; int n,k; int ans; bool check(int x) { if(x < 2) return false; for(int i=2;i*i<=x;i++) if(x % i == 0) r 阅读全文
posted @ 2020-09-17 19:08
Dazzling!
阅读(106)
评论(0)
推荐(0)
摘要:
const int N=20; char g[N][N]; bool col[N],dg[N],udg[N]; int n; void dfs(int u) { if(u == n) { for(int i=0;i<n;i++) cout<<g[i]<<endl; cout<<endl; retur 阅读全文
posted @ 2020-09-17 12:16
Dazzling!
阅读(133)
评论(0)
推荐(0)

浙公网安备 33010602011771号