摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1072 一开始看着题目太长,不想读了,就问了下XSY题意。可惜交流了半天也没弄清楚具体细节问题...无奈又回过去重新读了遍题。看来读题还是得自己做啊... 做的BFS题不多,队列的性质还没用熟练。#include<cstdio>#include<queue>#include<cstring>usingnamespacestd;inttur[4][2]={{1,0},{-1,0},{0,1},{0,-1}};structPoint{intx,y,time,step;};int 阅读全文
posted @ 2011-11-26 22:00 追逐. 阅读(272) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1010做的非常恶心的一题,一个脑残错找了N久,剪枝后还是那么慢...#include<iostream>#include<cstdio>usingnamespacestd;charstr[10][10];inttur[4][2]={{-1,0},{1,0},{0,-1},{0,1}};inte,n,m,t,di,dj;intabs(inta){returna<0?-a:a;}voiddfs(inti,intj,intct){if(i==di&&j==dj& 阅读全文
posted @ 2011-11-26 19:29 追逐. 阅读(173) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1372http://poj.org/problem?id=2243 擦了个擦的,N久前在杭电上做的这题0ms,到poj上一交直接超时!poj根本不让用stl啊。。 没办法,只能模拟队列又乱敲了遍。code1:#include<cstdio>#include<queue>usingnamespacestd;charbstr[3],estr[3];intb[2],e[2];inttur[8][2]={-1,-2,1,-2,-2,-1,2,-1,-1,2,1,2,-2,1,2,1};stru 阅读全文
posted @ 2011-11-26 17:51 追逐. 阅读(200) 评论(0) 推荐(0) 编辑