Search
文章平均质量分 72
bingsanchun
这个作者很懒,什么都没留下…
展开
-
黑白图像(DFS)
输入一个n*n的黑白图像(1表示黑色,0表示白色),任务是统计其中八连块的个数。如果两个黑格子有公共边或者公共顶点,就说它们属于同一个八连块。如图6-11所示的图形有3个八连块。原创 2013-07-30 14:55:10 · 1516 阅读 · 0 评论 -
poj1562--Oil Deposits(DFS)
DescriptionThe 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 th原创 2013-07-27 09:08:09 · 2196 阅读 · 0 评论 -
hdu2952——Counting Sheep(DFS&&BFS)
Problem DescriptionA while ago I had trouble sleeping. I used to lie awake, staring at the ceiling, for hours and hours. Then one day my grandmother suggested I tried counting sheep after I'd gone t原创 2013-07-28 21:12:20 · 1071 阅读 · 0 评论 -
SDJZUOJ迷宫问题(BFS)
题目描述小明置身于一个迷宫,请你帮小明找出从起点到终点的最短路程。小明只能向上下左右四个方向移动。输入格式输入包含多组测试数据。输入的第一行是一个整数T,表示有T组测试数据。每组输入的第一行是两个整数N和M(1接下来N行,每行输入M个字符,每个字符表示迷宫中的一个小方格。字符的含义如下:‘S’:起点‘E’:终点‘-’:空地,可以通过‘#’:障碍,无法原创 2013-07-28 19:53:54 · 2351 阅读 · 0 评论 -
最大乘积(暴力)
输入n个元素组成的序列S,你需要找出一个乘积最大的连续子序列。如果这个最大的乘积不是正整,应输出-1(表示无解)。1≤n≤18,-10≤Si≤10。样例输入:32 4-352 5-1 2 -1样例输出:820【分析】连续子序列有两个要素:起点和终点,因此只需要枚举起点和终点即可。由于每个元素的绝对值不超过10,一共又不超过18个元素,最大可能的乘积示会超过1原创 2013-08-11 16:54:33 · 3017 阅读 · 3 评论 -
hdu1010——Tempter of the Bone(DFS+剪枝)
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He re原创 2013-08-02 11:20:03 · 762 阅读 · 0 评论 -
UVA10010- Where's Waldorf?(string+暴搜)
Where's Waldorf? Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of原创 2013-10-12 23:57:48 · 1025 阅读 · 0 评论 -
HDU2553-N皇后问题(DFS)
Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output共有若干行,每行一个原创 2013-10-22 20:46:21 · 929 阅读 · 0 评论 -
HDU1016-Prime Ring Problem(DFS)
Problem DescriptionA 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原创 2013-10-23 11:29:42 · 878 阅读 · 0 评论