算法之搜索
cc_wood
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Key Task HDU - 1885
题目链接:点我 The Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the university buildings are old as well. And the navigation in原创 2017-07-20 10:21:15 · 271 阅读 · 0 评论 -
A strange lift HDU - 1548
题目链接:点我 here is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i原创 2017-07-20 08:54:22 · 245 阅读 · 0 评论 -
Eight HDU - 1043
题目链接:点我 The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and原创 2017-07-19 15:20:47 · 223 阅读 · 0 评论 -
Tempter of the Bone HDU - 1010
题目链接: 点这里Time limit 1000 ms Memory limit 32768 kb The 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原创 2017-07-19 15:10:43 · 218 阅读 · 0 评论 -
Anniversary Cake POJ - 1020
题目链接:点这里 Nahid Khaleh decides to invite the kids of the "Shahr-e Ghashang" to her wedding anniversary. She wants to prepare a square-shaped chocolate cake with known size. She asks each invited pers原创 2017-07-19 14:53:03 · 437 阅读 · 0 评论 -
Sum It Up HDU - 1258
题目链接:点这里 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 t=4, n=6, and the list is 4,3,2,2,1,14,3,2,2,1,1, th原创 2017-07-19 14:17:46 · 319 阅读 · 0 评论 -
生日蛋糕 POJ - 1190
题目链接:点这里 7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 <= i <= M)层蛋糕是半径为Ri, 高度为Hi的圆柱。当i < M时,要求Ri > Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。 令原创 2017-07-19 11:46:44 · 289 阅读 · 0 评论 -
A Knight's Journey POJ - 2488
题目链接:点这里Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is two原创 2017-07-19 11:29:17 · 300 阅读 · 0 评论 -
Sticks POJ - 1011
题目链接:点这里 George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks原创 2017-07-19 11:17:14 · 310 阅读 · 0 评论 -
How Many Equations Can You Find HDU - 2266
题目链接:点这里Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’-’ between the characters. Just like give you a string “12345”, you can work out a原创 2017-07-19 10:57:27 · 314 阅读 · 0 评论 -
N皇后问题 HDU - 2553
题目链接:点这里 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sample原创 2017-07-19 10:48:17 · 332 阅读 · 0 评论 -
逃离迷宫 HDU - 1728
题目链接:点我 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会原创 2017-07-20 11:09:07 · 237 阅读 · 0 评论 -
Catch That Cow POJ - 3278
题目链接:点我 Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤原创 2017-07-20 11:02:39 · 231 阅读 · 0 评论 -
Ignatius and the Princess I HDU - 1026
题目链接:点我 The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess. Now he gets into feng5166's castle. The castle is a large labyrinth. To make t原创 2017-07-20 10:56:55 · 309 阅读 · 0 评论 -
诡异的楼梯 HDU - 1180
题目链接:点我 Hogwarts正式开学以后,Harry发现在Hogwarts里,某些楼梯并不是静止不动的,相反,他们每隔一分钟就变动一次方向. 比如下面的例子里,一开始楼梯在竖直方向,一分钟以后它移动到了水平方向,再过一分钟它又回到了竖直方向.Harry发现对他来说很难找到能使得他最快到达目的地的路线,这时Ron(Harry最好的朋友)告诉Harry正好有一个魔法道具可以帮助他寻找原创 2017-07-20 10:46:15 · 279 阅读 · 0 评论 -
Nightmare Ⅱ HDU - 3085
题目链接:点我 Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maze. They will原创 2017-07-20 10:32:29 · 305 阅读 · 0 评论 -
Biridian Forest CodeForces - 329B (逆向bfs)
题目链接:点我题意:实际上就是问有多少人可以在开始位置S之前到达终点.思路:逆向bfs,记录从终点开始到每个点的距离,然后找出所有的距离比起点离终点小的点,把他们的人数加起来即可.代码:#include<cstdio>#include<cstring>#include<cmath>#include<iostream>using namespace std;const int maxn = 1原创 2017-08-12 13:46:05 · 432 阅读 · 1 评论
分享