摘要:
1.典型的宽度优先搜索;2.典型的队列使用问题;3.刚开始一直WA,原来是边界弄错了,切记,越界就是wa以下是代码:#include #include #include #include using namespace std; int step[100010], flag[100010];
queue q; void bfs(int n, int k)
{ q.push(n); flag[n] = 1; while(q.size()) { int x = q.front(); q.pop(); i... 阅读全文
posted @ 2012-02-28 17:30
赵乐ACM
阅读(207)
评论(0)
推荐(0)
浙公网安备 33010602011771号