码迷,mamicode.com
首页 >  
搜索关键字:zoj bfs    ( 8652个结果
ZOJ - 1709 Oil Deposits
油田问题,有点像图像处理里的区域生长问题,找油田块数。BFS,DFS都可以。 1 /*BFS*/ 2 #include 3 #include 4 const int maxn=100+5,maxm=1000; 5 int m,n,vis[maxn][maxn],mat[maxn][maxn],dir...
分类:其他好文   时间:2014-07-18 16:19:41    阅读次数:267
ZOJ 2975 Kinds of Fuwas
K - Kinds of Fuwas Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluDescriptionIn the year 2008, the 29th Olympic Games will be held ...
分类:其他好文   时间:2014-07-18 00:19:24    阅读次数:357
ZOJ 2969 Easy Task
E - Easy TaskDescriptionCalculating the derivation of a polynomial is an easy task. Given a function f(x) , we use (f(x))' to denote its derivation. W...
分类:其他好文   时间:2014-07-18 00:15:29    阅读次数:262
ZOJ 2970 Faster, Higher, Stronger
F - Faster, Higher, Stronger Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit Status Practice ZOJ 2970DescriptionIn the year 2...
分类:其他好文   时间:2014-07-18 00:05:06    阅读次数:253
ZOJ 2965 Accurately Say CocaCola
A - Accurately Say "CocaCola"!DescriptionIn a party held by CocaCola company, several students stand in a circle and play a game.One of them...
分类:其他好文   时间:2014-07-18 00:01:04    阅读次数:239
POJ 3083:Children of the Candy Corn(DFS+BFS)
Children of the Candy Corn Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9311 Accepted: 4039 Description The cornfield maze is a popular Hallowee...
分类:其他好文   时间:2014-07-17 21:09:46    阅读次数:319
poj 2251 Dungeon Master(bfs)
题意:这题从二维空间扩展到三维空间了,可以上下左右前后移动,每次都只能移到相邻的空位, 每次需要花费一分钟,求从起点到终点最少要多久 #表示岩石,.表示空位,S是起点,E是终点...
分类:其他好文   时间:2014-07-17 19:20:47    阅读次数:237
POJ 2243 || HDU 1372:Knight Moves(BFS)
简单搜索 直接代码: #include #include #include #include using namespace std; char a,c; int e,f; int dx[8] = {-2, -2, -1, -1, 1, 1, 2, 2}; int dy[8] = {-1, 1, -2, 2, -2, 2, -1, 1}; int qq[9][9]; struct node {...
分类:其他好文   时间:2014-07-17 19:05:30    阅读次数:265
Zoj 3088 Easter Holidays SPFA+枚举
其实就是枚举最高点和起点,然后以最高点为源点在两张图上分别做spfa。一遍最短路,一遍最长路。暴露出来的问题:思维不够清晰,代码能力还不够#include #include #include #include #include #include #include #include #include ...
分类:其他好文   时间:2014-07-17 18:16:43    阅读次数:206
ZOJ 1649
这题要用BFS去做,要注意的是’x‘,这里可以有优先队列去做,会很简单;另一个要注意的是,a只有一个,r可能有很多个,所以可以用a去找最接近的r;#include #include #include "string.h"using namespace std;struct step{ int x,y...
分类:其他好文   时间:2014-07-17 18:13:36    阅读次数:180
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!