
深度优先搜索
文章平均质量分 82
xiaoleiacm
asdfghjkl;
展开
-
POJ 2907 Collecting Beepers
Collecting BeepersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2236 Accepted: 1214DescriptionKarel is a robot who lives in a rectangular coordinate s原创 2012-10-21 11:48:20 · 704 阅读 · 0 评论 -
Seeding zoj
SeedingTime Limit: 2 Seconds Memory Limit: 65536 KB It is spring time and farmers have to plant seeds in the field. Tom has a nice field, which is a rectangle with n * m squares. There are b原创 2013-08-04 10:40:26 · 852 阅读 · 0 评论 -
N皇后问题 hdu 2553
N皇后问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5729 Accepted Submission(s): 2596Problem Description在N*原创 2013-08-04 22:29:41 · 884 阅读 · 0 评论 -
poj LETTERS 1154
LETTERSTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5601 Accepted: 2661DescriptionA single-player game is played on a rectangular board divided in R ro原创 2013-08-04 16:30:32 · 1232 阅读 · 0 评论 -
zoj 1002 Fire Net
Fire NetTime Limit: 2 Seconds Memory Limit: 65536 KB Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representin原创 2013-08-05 12:13:33 · 714 阅读 · 0 评论 -
poj 1321 棋盘问题
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18683 Accepted: 9276Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解原创 2013-08-05 16:37:55 · 653 阅读 · 0 评论 -
Sum It Up poj 1711
Sum It UpTime Limit: 2 Seconds Memory Limit: 65536 KB Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if原创 2013-08-07 16:48:25 · 765 阅读 · 0 评论 -
Gnome Tetravex zoj
Gnome TetravexTime Limit: 10 Seconds Memory Limit: 32768 KB Hart is engaged in playing an interesting game, Gnome Tetravex, these days. In the game, at the beginning, the player is given n原创 2013-08-07 23:44:43 · 841 阅读 · 0 评论 -
zoj Exchange Cards
Exchange CardsTime Limit: 2 Seconds Memory Limit: 65536 KB As a basketball fan, Mike is also fond of collecting basketball player cards. But as a student, he can not always get the money t原创 2013-08-08 10:41:35 · 986 阅读 · 0 评论 -
Securing the Barn poj
Securing the BarnTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1860 Accepted: 1191DescriptionFarmer John has installed a new security system on the ba原创 2013-08-08 11:07:43 · 1139 阅读 · 0 评论 -
dfs总结
dfs总结深搜dfs 排列组合时要注意是否是要字典序进行输出 如果是 则需要在dfs前先进行排序 同时 在搜索方向时 要以前一个搜索最后一个结点为下一个搜索的起点 这样就不会重复了~对于一些矩形或者图形的搜索,如果是以下标开始计数(cur) 当cur走到最大值即(n*M)时 可省去for循环 x=cur%n,y=cur/n;数据量大 或者有重复数据时要注意原创 2013-08-08 19:19:32 · 1238 阅读 · 0 评论 -
hdu 1016 Prime Ring Problem
Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19988 Accepted Submission(s): 8954P原创 2013-07-29 17:17:42 · 667 阅读 · 0 评论 -
hdu 1312 Red and Black
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6461 Accepted Submission(s): 4087Problem原创 2013-07-29 15:37:07 · 632 阅读 · 0 评论 -
poj 3009 Curling 2.0
Curling 2.0Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7356 Accepted: 3069DescriptionOn Planet MM-21, after their Olympic games this year, curling i原创 2012-10-30 19:46:23 · 494 阅读 · 0 评论 -
poj 2488 A Knight's Journey
A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22289 Accepted: 7537DescriptionBackgroundThe knight is getting bored of seeing the s原创 2012-10-24 20:41:30 · 820 阅读 · 0 评论 -
poj 3083 Children of the Candy Corn
Children of the Candy CornTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7013 Accepted: 3071DescriptionThe cornfield maze is a popular Halloween treat. V原创 2012-11-03 00:00:28 · 554 阅读 · 0 评论 -
poj 2386 Lake Counting
Lake CountingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 14703 Accepted: 7452DescriptionDue to recent rains, water has pooled in various places in Far原创 2012-11-05 20:31:46 · 479 阅读 · 0 评论 -
NEFU要崛起——第5场 B - President's Office
B -President's Office Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Sta原创 2012-12-14 11:24:24 · 846 阅读 · 1 评论 -
排列组合 dfs
组合数时间限制:3000 ms | 内存限制:65535 KB难度:3描述找出从自然数1、2、... 、n(0<n<10)中任取r(0<r<=n)个数的所有组合。输入输入n、r。输出按特定顺序输出所有组合。特定顺序:每一个组合中的值从大到小排列,组合之间按逆字典序排列。样例输入5 3样例输出543542541原创 2013-08-03 10:48:42 · 1848 阅读 · 2 评论 -
Lotto zoj 1089
LottoTime Limit: 2 Seconds Memory Limit: 65536 KB In a Lotto I have ever played, one has to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn原创 2013-08-04 15:03:09 · 787 阅读 · 0 评论 -
NYOJ 吝啬的国度
吝啬的国度时间限制:1000 ms | 内存限制:65535 KB难度:3描述在一个吝啬的国度里有N个城市,这N个城市间只有N-1条路把这个N个城市连接起来。现在,Tom在第S号城市,他有张该国地图,他想知道如果自己要去参观第T号城市,必须经过的前一个城市是几号城市(假设你不走重复的路)。输入第一行输入一个整数M表示测试数据共有M(1每组原创 2013-08-03 16:13:34 · 837 阅读 · 0 评论 -
hdu 1010 Tempter of the Bone
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 52798 Accepted Submission(s): 14196原创 2013-07-29 09:48:59 · 577 阅读 · 0 评论 -
hdu 1241 Oil Deposits
Oil Deposits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7890 Accepted Submission(s原创 2013-07-29 10:27:41 · 625 阅读 · 0 评论 -
Farm Irrigation zoj
Farm IrrigationTime Limit: 2 Seconds Memory Limit: 65536 KB Benny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipe原创 2013-08-08 19:02:59 · 737 阅读 · 0 评论