
深度优先搜索
__铭
这个作者很懒,什么都没留下…
展开
-
poj 2488 A Knight's Journey
题意:给你一个n*m的矩阵,看能从(1,1)点开始按照字典序开始遍历,能否遍历n*m内的所有的点 盗张图~~ 没找到,但我见到过,、等找到再发吧~~ 按照字典序遍历,其实就是规定遍历的优先方向,也就是下面这个 int Dir[][2] = {{-2,-1},{-2,1},{-1,-2},{-1,2},{1,-2},{1,2},{2,-1},{2,1}}; Description原创 2015-08-17 21:26:23 · 359 阅读 · 0 评论 -
poj 1416 Shredding Company(DFS减枝)
Description You have just been put in charge of developing a new shredder for the Shredding Company Although a "normal" shredder would just shred sheets of paper into little pieces so that the conten原创 2015-08-21 14:02:58 · 386 阅读 · 0 评论 -
poj 2676(DFS减枝)
Description Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 t原创 2015-08-21 14:07:42 · 425 阅读 · 0 评论 -
poj 1129 Channel Allocation(DFS减枝)
Description When a radio station is broadcasting over a very large area, repeaters are used to retransmit the signal so that every receiver has a strong signal. However, the channels used by each rep原创 2015-08-21 14:10:52 · 453 阅读 · 0 评论 -
BestCoder Round #49 ($) 1001
Problem Description There is an integer aaa and nnn integers b1,…,bnb_1, \ldots, b_nb1,…,bn. After selecting some numbers from b1,…,bnb_1, \ldots, b_nb1,…,bn in any order, say c原创 2015-08-01 20:34:09 · 622 阅读 · 0 评论 -
HDU 5612 Baby Ming and Matrix games (搜索)
Baby Ming and Matrix games Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 392 Accepted Submission(s): 82 Problem Description原创 2016-01-24 15:02:34 · 600 阅读 · 0 评论 -
HDU 5587 Array
Array Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)原创 2015-12-01 13:42:00 · 835 阅读 · 0 评论 -
HDU 5587 Array
Array Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 330 Accepted Submission(s): 163 Problem Description Vicky is a magicia原创 2015-11-30 13:03:53 · 512 阅读 · 0 评论 -
poj 1321
POJ 难得的中文题,秒敲 Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及原创 2015-08-17 21:32:45 · 383 阅读 · 0 评论 -
poj 3009 Curling 2.0
Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a squa原创 2015-08-17 21:28:34 · 332 阅读 · 0 评论 -
poj 2251 Dungeon Master
还是简单的搜索题,只是简单的把3二维转化成3维,多写几个方向和括号就OK了 QAQ~ Description 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 w原创 2015-08-18 09:10:14 · 351 阅读 · 0 评论 -
poj 2531 Network Saboteur(DFS减枝)
题意:将n个计算机分成两部分,求权值的最大值 方法:先默认将所有的放入一个集合,然后将里面的元素一个一个的转移到另一个集合 Description A university network is composed of N computers. System administrators gathered information on the traffic between nodes,原创 2015-08-20 10:51:16 · 420 阅读 · 0 评论