2012年4月3日

HDU 4198 Quick out of the Harbour(BFS+最小优先队列)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4198大意:起点S到出口的最短花费。。。。。其中#为障碍物。。。。 '.'的花费为1 。。。@的花费为c+1。。。。c是第三个输入数据师兄说过可以dijstra。。。但是我还没试过。。。。留着以后在试吧。#include <iostream>#include <queue>using namespace std;struct point{ int x, y, v; friend bool operator < (point a, point b) { re. 阅读全文

posted @ 2012-04-03 19:18 [S*I]SImMon_WCG______* 阅读(413) 评论(0) 推荐(0) 编辑

HDU 1241 Oil Deposits

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1241大意:计算图中有几大块@#include <iostream>#include <queue>using namespace std;struct point{ int x, y;};char g[111][111];int xx[8] = {1,1,1,0,0,-1,-1,-1};int yy[8] = {1,0,-1,1,-1,1,0,-1};int sum;int n, m;void Bfs(int x, int y)//广搜目的:把该块@全去掉。。{ point q 阅读全文

posted @ 2012-04-03 15:55 [S*I]SImMon_WCG______* 阅读(178) 评论(0) 推荐(0) 编辑

HDU 1372 Knight Moves

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1372大意:给你一个8*8的棋盘,马从起点到终点的最小步数。。。#include <iostream>#include <queue>using namespace std;struct point{ int x, y, v;//v是从始点到该点的步数。};int g[10][10];int xx[8] = {1,1,-1,-1,2,2,-2,-2};int yy[8] = {2,-2,2,-2,1,-1,1,-1};int main(){ int i, j; char a[5] 阅读全文

posted @ 2012-04-03 15:18 [S*I]SImMon_WCG______* 阅读(193) 评论(0) 推荐(0) 编辑

HDU 1312 Red and Black (第一道广搜)

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1312大意:从@出发,只能站在不能站在#上。。。。求能踩到的.的个数(包括起始点@)#include <set>#include <map>#include <list>#include <cmath>#include <ctime>#include <deque>#include <queue>#include <stack>#include <cstdio>#include <strin 阅读全文

posted @ 2012-04-03 00:38 [S*I]SImMon_WCG______* 阅读(302) 评论(0) 推荐(0) 编辑

导航