
DFS与BFS
文章平均质量分 83
Pira
追求梦想的人,难免有些不切实际。。。
展开
-
Section 4.1 Fence Rails(DFS_ID迭代加深搜索+剪枝)
Fence Rails Burch, Kolstad, and Schrijvers Farmer John is trying to erect a fence around part of his field. He has decided on the shape of the fence and has even already installed the posts, but h原创 2012-07-22 14:54:20 · 992 阅读 · 0 评论 -
usaco 4.1 Cryptcowgraphy(DFS+hash+剪枝)
Cryptcowgraphy Brian Dean The cows of Farmer Brown and Farmer John are planning a coordinated escape from their respective farms and have devised a method of encryption to protect their written co原创 2012-07-23 18:34:29 · 778 阅读 · 0 评论 -
usaco 4.2 Cowcycles(搜索+剪枝)
Cowcycles Originally by Don Gillies [International readers should note that some words are puns on cows.] Having made a fortune on Playbov magazine, Hugh Heifer has moved from his original field in原创 2012-07-25 20:26:27 · 1406 阅读 · 0 评论 -
usaco 5.1 Starry Night(BFS+枚举)
Starry Night IOI 98 High up in the night sky, the shining stars appear in clusters of various shapes. A cluster is a non-empty group of neighbouring stars, adjacent in horizontal, vertical or diagon原创 2012-09-21 20:26:37 · 1393 阅读 · 0 评论 -
usaco 5.2 Snail Trails(DFS)
Snail Trails All Ireland Contest Sally Snail likes to stroll on a N x N square grid (1 <n <= 120). She always starts in the upper left corner of the grid. The grid has empty squares (denoted below b原创 2012-09-21 21:45:41 · 1034 阅读 · 0 评论 -
usaco 4.4 Shuttle Puzzle(字符hash+搜索)
Shuttle Puzzle Traditional The Shuttle Puzzle of size 3 consists of 3 white marbles, 3 black marbles, and a strip of wood with 7 holes. The marbles of the same color are placed in the holes at the o原创 2012-09-20 14:22:40 · 2485 阅读 · 0 评论 -
usaco 4.3 Street Race(搜索)
Street Race IOI'95 Figure 1 gives an example of a course for a street race. You see some points, labeled from 0 to N (here, N=9), and some arrows connecting them. Point 0 is the start of the race; p原创 2012-09-20 10:15:52 · 697 阅读 · 0 评论 -
usaco 5.2 Wisconsin Squares(DFS)
Wisconsin Squares It's spring in Wisconsin and time to move the yearling calves to the yearling pasture and last year's yearlings to the greener pastures of the north 40. Farmer John has five kind原创 2012-09-24 15:43:17 · 1041 阅读 · 0 评论 -
ZOJ 2962 Stack By Stack(递归)
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2962 题意:给你n个栈,每个栈给定大小为Ci,现在进行这样的操作: 情况1,当没有栈是满的情况,将第一个栈装入1~C1的数,也就是装满; 情况2,有一个栈i已经装满,那么将栈i的内容逐个弹出,装到下一个栈i+1中,直到栈i+1满了,或者栈i空了,注意如果栈i+1原创 2013-06-24 15:19:46 · 2325 阅读 · 0 评论