摘要: 搜索,广度优先。 之前使用的遍历超时了,没办法,学习了队列的写法。以下代码源自网上,改了一点,AC#include<iostream>#include<deque>using namespace std;int main(){ int i,a,b,n,x,y,s[201],t[201]; deque<int> q; while(cin>>n && n) { q.clear(); memset(t,0,sizeof(t)); cin>>a>>b; for(i=1;i<=n;i++) cin... 阅读全文
posted @ 2013-02-19 10:17 SF-_- 阅读(164) 评论(0) 推荐(0) 编辑