![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
您还不是尊贵的会员身份
这个作者很懒,什么都没留下…
展开
-
uva-524 Prime Ring Problem 回溯法
回溯法搜索+素数判断 本题的输出格式及其坑,需要注意 #include<cstdio> #include<iostream> #include<cstring> #include<cmath> using namespace std; int vis[20]; int cur=0; int ans[20]; int n; bool pri...原创 2018-03-06 20:55:51 · 180 阅读 · 0 评论 -
Educational Codeforces Round 34 div2 Hungry Student Problem 简单dfs
Hungry Student Problem Ivan’s classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken. CFK sells chicken chunks in small and large porti...原创 2017-12-15 09:42:26 · 222 阅读 · 0 评论 -
汉诺塔递归
汉诺塔递归 //汉诺塔 #include<iostream> #include<cstdio> #include<math.h> using namespace std; void hanoi(int n,char a,char b,char c) { if(n==1) printf("1 from %c to %c\n",a,c); else ...原创 2017-12-13 22:15:12 · 158 阅读 · 0 评论 -
POJ1321棋盘问题(DFS)
棋盘问题 Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 51252Accepted: 24781 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。...原创 2017-10-07 11:52:33 · 197 阅读 · 0 评论 -
DFS求连通块 UVa 572 Oil Deposits
Oil Deposits The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid t...原创 2018-03-08 21:34:45 · 137 阅读 · 0 评论 -
回溯法 八皇后和N皇后
八皇后 在国际象棋棋盘上放置八个皇后,要求每两个皇后之间不能直接吃掉对方。 Input 无输入。 Output 按给定顺序和格式输出所有八皇后问题的解(见Sample Output)。 Sample Input Sample Output No. 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0...原创 2018-03-06 17:49:45 · 501 阅读 · 0 评论