摘要: 简单搜索深度优先搜索poj2488,poj3083,poj3009,poj1321广度优先搜索poj2251,poj1426,poj3126,poj3087.poj3414poj 1606简单搜索技巧和剪枝poj2531,poj1416,poj2676,poj1129poj 2488好恶心的题。。。应该用深搜的,我用的bfs,wa掉,改成dfs,还是wa。。。注意向八个方向扩展的顺序,保证输出结果按字典序排列。int dir[8][2] = {{-2, -1},{-2, 1},{-1, -2},{-1, 2},{1, -2},{1, 2},{2, -1},{2, 1}};贡献无数wa,... 阅读全文
posted @ 2012-03-21 15:57 AC_Von 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 客观原因很多,但我不想找了。水平在那摆着。。。。以后做比赛尽量找一个安静的点环境,比如实验室。昨晚一题没做出来,今天回头又翻了翻300pt:其实是道水题,很水很水的题。。。先统计出L,R所能到达的最远位置。然后把'?'补给大的。如果dis(L) = dis(R) 则补给第一个出现的。View Code #include <vector>#include <list>#include <map>#include <set>#include <queue>#include <deque>#include < 阅读全文
posted @ 2012-03-21 15:47 AC_Von 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 做tc时被这个问题纠结住了,后来问了大牛,可以这样写。 1 class EvenRoute { 2 public: 3 struct node { 4 int x; 5 int y; 6 node(int a = 0, int b = 0) : x(a), y(b) {} 7 }; 8 9 static bool cmp(const node& c, const node& d) { //加static10 if(c.x == d.x) return c.y < d.y;11 ... 阅读全文
posted @ 2012-03-21 09:48 AC_Von 阅读(1441) 评论(0) 推荐(0) 编辑