
搜索
文章平均质量分 86
czdb
这个作者很懒,什么都没留下…
展开
-
N皇后问题 HDU - 2553
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sample原创 2016-12-14 21:39:51 · 291 阅读 · 0 评论 -
棋盘问题 POJ - 1321
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 当为-1 -1时表示输入结束原创 2016-12-16 19:42:30 · 297 阅读 · 0 评论 -
Red and Black HDU - 1312
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can'原创 2016-12-17 14:28:55 · 368 阅读 · 0 评论 -
Oil Deposits HDU - 1241
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 that divides th原创 2016-12-17 15:11:07 · 307 阅读 · 0 评论 -
Rat Attack POJ - 1916
Background Baaaam! Another deadly gas bomb explodes in Manhattan's underworld. Rats have taken over the sewerage and the city council is doing everything to get the rat population under control. A原创 2016-12-14 14:46:24 · 475 阅读 · 0 评论 -
Prime Ring Problem HDU - 1016
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number原创 2016-12-15 14:13:37 · 253 阅读 · 0 评论 -
Preparing Olympiad CodeForces - 550B
You have n problems. You have estimated the difficulty of thei-th one as integer ci. Now you want to prepare a problemset for a contest, using some of the problems you've made.A problemset for t原创 2016-12-18 16:29:20 · 356 阅读 · 0 评论 -
CSU 1908: The Big Escape
DescriptionThere is a tree-like prison. Expect the root node, each node has a prisoner, and the root node is the only exit. Each node can accommodate a large number of prisoners, but each edge per m原创 2017-05-01 22:07:18 · 361 阅读 · 0 评论 -
csu:1887: Cuckoo Hashing
Description One of the most fundamental data structure problems is the dictionary problem: given a set D of words you want to be able to quickly determine if any given query string q is present in原创 2017-04-26 22:30:43 · 318 阅读 · 0 评论