![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
bfs
yun_weiguo
这个作者很懒,什么都没留下…
展开
-
poj 2251
这道题目挺崩溃的。以为用 vis 数组判断是否访问过,以及 g数组存地图。没想到竟然会越过地图的边界(数组没越界)。蹦了。最近做了好几道bfs 的题目。终于对bfs 的题目有感觉了!!! #include #include #include #include using namespace std;char g[40][40][40];int vis[40]原创 2015-02-17 15:49:46 · 223 阅读 · 0 评论 -
poj 3278
这是一道很水的bfs 题目。但是要注意的是 数组要开大点。因为 可能会访问到200000. 注意剪枝。否则会超时的。#include #include #include using namespace std;const int N=200010;int n,k,ans;bool vis[N];int cnt[N];void bfs(in原创 2015-02-16 23:53:58 · 377 阅读 · 0 评论