摘要:
//八皇后递归解法 //#include //using namespace std; #include int queen[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int count = 0;//定义一个全局变量 int n;//(推广到n个皇后问题) bool available(int pointi,int pointj) //判断某个皇后是否与已有皇后冲... 阅读全文
posted @ 2018-11-29 23:12
DWVictor
阅读(1499)
评论(0)
推荐(0)
摘要:
八皇后递归详解 核心代码如下: //八皇后递归解法 #include<iostream> using namespace std; int queen[9] = {-1,-1,-1,-1,-1,-1,-1,-1,-1}; int count = 0;//定义一个全局变量 bool available 阅读全文
posted @ 2018-11-29 23:08
DWVictor
阅读(1788)
评论(0)
推荐(1)
摘要:
总所周知,我们使用搜索以及许多算法,都要用到递归,递归的使用要弄明白并不难,但是想要理解搜索中dfs的使用就要理解一番, 以如下代码为例: 阅读全文
posted @ 2018-11-29 22:47
DWVictor
阅读(2971)
评论(0)
推荐(1)
摘要:
//小球ball //desk 阅读全文
posted @ 2018-11-29 11:14
DWVictor
阅读(623)
评论(1)
推荐(0)
摘要:
没什么好介绍的,嘻嘻 阅读全文
posted @ 2018-11-29 10:51
DWVictor
阅读(313)
评论(0)
推荐(0)
摘要:
连连看Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 27040 Accepted Submission(s): 6722 Problem D 阅读全文
posted @ 2018-11-29 10:39
DWVictor
阅读(574)
评论(0)
推荐(0)
摘要:
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2 阅读全文
posted @ 2018-11-29 10:35
DWVictor
阅读(641)
评论(0)
推荐(0)
摘要:
蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起移动,游戏的目的是将所有的牌按同一花色从小到大排好,为了简单起见,我们的游戏只有同一花色的10张牌,从A到10,且随机的在一 阅读全文
posted @ 2018-11-29 10:33
DWVictor
阅读(638)
评论(0)
推荐(0)
摘要:
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You m 阅读全文
posted @ 2018-11-29 10:32
DWVictor
阅读(285)
评论(0)
推荐(0)
摘要:
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. 阅读全文
posted @ 2018-11-29 10:30
DWVictor
阅读(590)
评论(0)
推荐(0)
摘要:
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将 阅读全文
posted @ 2018-11-29 10:29
DWVictor
阅读(455)
评论(0)
推荐(0)
摘要:
Cleaning Robot (bfs+dfs) Here, we want to solve path planning for a mobile robot cleaning a rectangular room floor with furniture. Consider the room f 阅读全文
posted @ 2018-11-29 10:27
DWVictor
阅读(429)
评论(0)
推荐(0)
摘要:
生日蛋糕 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我 阅读全文
posted @ 2018-11-29 10:25
DWVictor
阅读(814)
评论(0)
推荐(0)
摘要:
c语言中经常需要通过函数传递二维数组,有三种方法可以实现,如下: 方法一, 形参给出第二维的长度。 例如: 方法二,形参声明为指向数组的指针。 例如: 方法三,形参声明为指针的指针。 例如: 附加,第三种传参方式说明:在函数中使用传参过来的二维数组(指针)进行数组取值的时候不能使用(array[i] 阅读全文
posted @ 2018-11-29 10:20
DWVictor
阅读(20141)
评论(0)
推荐(6)

浙公网安备 33010602011771号