
深度优先
文章平均质量分 59
ultimater
桃李争辉飒爽英姿斗艳,成功失败总是欢乐伤悲!
展开
-
POJ 2245 Lotto
DescriptionIn the German Lotto you have to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance of winning - is to select a subse原创 2012-08-07 14:03:49 · 1139 阅读 · 0 评论 -
POJ 1164 放苹果
Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3原创 2012-08-07 23:03:09 · 1415 阅读 · 0 评论 -
POJ 1321 棋盘问题
Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n原创 2012-07-30 17:44:38 · 854 阅读 · 0 评论 -
ZOJ 3631 Watashi's BG
DescriptionWatashi is the couch of ZJU-ICPC Team and he is very kind hearted. In ZJU-ICPC summer training camp, students are divided into several groups and each day one of the groups will design原创 2012-07-31 07:16:39 · 1536 阅读 · 0 评论 -
POJ 2243 Knight Moves
DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The Problem Your原创 2012-07-30 23:18:42 · 838 阅读 · 0 评论 -
POJ 1154 LETTERS
DescriptionA single-player game is played on a rectangular board divided in R rows and C columns. There is a single uppercase letter (A-Z) written in every position in the board. Before the begg原创 2012-08-20 22:40:51 · 1471 阅读 · 0 评论 -
数独解法
//25...9.4.//4.71.3..6//8.34.759.//3.8.7..69//.1.3.24..//5.49.6.83//9.6.3.7.8//.3.6.8.1.//1.2.9.6.4struct node{ node(int r,int c):row(r),col(c) {} friend ostream& operator <<(ostr原创 2014-08-02 15:01:14 · 1413 阅读 · 0 评论