代码改变世界

随笔分类 -  ACM_搜索专题

poj 3009 Curling 2.0-----搜索

2012-07-15 10:51 by java环境变量, 307 阅读, 收藏,
摘要: Curling 2.0Time Limit:1000MSMemory Limit:65536KTotal Submissions:6807Accepted:2841DescriptionOn 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 square mesh is marked. The 阅读全文

poj 2386 Lake Counting-----DFS

2012-05-16 20:28 by java环境变量, 275 阅读, 收藏,
摘要: Lake CountingTime Limit:1000MSMemory Limit:65536KTotal Submissions:13556Accepted:6909DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each square contains ei 阅读全文

poj 1252 Euro Efficiency-----BFS 遍历,记录最短路

2012-05-15 17:13 by java环境变量, 297 阅读, 收藏,
摘要: Euro EfficiencyTime Limit:1000MSMemory Limit:10000KTotal Submissions:2158Accepted:965DescriptionOn January 1st 2002, The Netherlands, and several other European countries abandoned their national currency in favour of the Euro. This changed the ease of paying, and not just internationally.A student 阅读全文

poj 3414 Pots ----BFS 最短路和路径

2012-03-10 16:40 by java环境变量, 284 阅读, 收藏,
摘要: PotsTime Limit:1000MSMemory Limit:65536KTotal Submissions:6222Accepted:2614Special JudgeDescriptionYou are given two pots, having the volume ofAandBliters respectively. The following operations can be performed:FILL(i) fill the poti(1 ≤i≤ 2) from the tap;DROP(i) empty the potito the drain;POUR(i,j) 阅读全文

poj 2251 Dungeon Master ----BFS (三维六个方向)

2012-03-08 19:44 by java环境变量, 291 阅读, 收藏,
摘要: Dungeon MasterTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 10701Accepted: 4129DescriptionYou 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. It takes one minute to move one unit north, sou. 阅读全文

poj 3083 children of the candy corn----DFS 和BFS (蛋疼的方向)

2012-03-08 13:52 by java环境变量, 430 阅读, 收藏,
摘要: Children of the Candy CornTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6047Accepted: 2637DescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing zombies, chainsaw-wielding psychopaths, hippies, and other terrors. 阅读全文

poj 2676 sudoku ( 数独)----DFS

2012-03-07 19:20 by java环境变量, 299 阅读, 收藏,
摘要: SudokuTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 9664Accepted: 4786Special JudgeDescriptionSudoku 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 to 9. Th. 阅读全文

hdu 1241 Oil Deposits----DFS

2012-02-29 00:22 by java环境变量, 235 阅读, 收藏,
摘要: Oil DepositsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4219Accepted Submission(s): 2415Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangul 阅读全文

hdu 2553 N皇后问题----搜索 dfs 回溯法 预处理

2012-02-12 16:54 by java环境变量, 466 阅读, 收藏,
摘要: hdu 2553 N皇后问题 原题链接 http://acm.hdu.edu.cn/showproblem.php?pid=2553 今下午看了一下八皇后问题,所以强烈的想AC一道题。。hdu上的此题 刚刚好。哈哈。 题目大意:在一个n*n的棋盘上放置n个皇后棋子。皇后可以向行,列,对角线攻击。求皇后互不攻击的摆法有多少种。 回溯法以前看到过名称 ,但不懂具体怎么用。 今天终于是理解一点了。回溯法的精华就是边生成边检验,所以减少了很多不必要的枚举。 具体的思路会在代码中有注释。 这道题最直接的思路就是枚举 暴力解决,但是显然是不行的。所以只能用回溯。 基本思路,一行一行的放 皇后, 然后再递归 阅读全文