摘要:
一、DFS实现N皇后 1 #include<bits/stdc++.h> 2 using namespace std; 3 int ans[10];//用于存放答案 4 int tot;//方案数 5 const int n=8;//N皇后问题 6 bool check(int c, int r){ 阅读全文
摘要:
题目链接:https://blog.csdn.net/wly_2014/article/details/51388263 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=64; 4 int n, matchlist[ 阅读全文
摘要:
题目链接:https://www.luogu.com.cn/problem/P1002 1 #include<bits/stdc++.h> 2 using namespace std; 3 int bx, by, mx, my; 4 long long f[25][25]; //f[x][y]表示从 阅读全文
摘要:
题目连接 https://www.luogu.com.cn/problem/P3156 方法一: 数组写法 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m, q; 4 int a[2000005]; 5 int main() 6 阅读全文
摘要:
https://www.luogu.com.cn/problem/P4913 #include<bits/stdc++.h> using namespace std; struct node{ int l, r; }; node a[1000005]; int n, ans=-1; void dfs 阅读全文
摘要:
https://www.luogu.com.cn/problem/P1478 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, s, a, b; 4 struct apple{ //结构体定义苹果的高度和摘苹果所用的力气 5 int 阅读全文
摘要:
https://www.luogu.com.cn/problem/P2240 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, t; 4 struct jb{ //金币结构体 5 int m, v;//重量,价值 6 }; 7 jb 阅读全文
摘要:
https://www.luogu.com.cn/problem/P1036 方法一:递归回溯+素数判断 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, k, ans=0; 4 int x[25], a[25]; 5 bool vi 阅读全文