摘要: 思路: DFS+回溯,单单这样会超时,需奇偶性剪枝,即|x2-x1|+|y2-y1|与步数的奇偶性相同,不相同直接输出"NO",相同再进行DFS 1 #include 2 #include 3 #include 4 #include 5 6 #define REP(i,l,r) for(int i=(l);i=(r);--i) 8 #define SCAN(n) scanf("%d",&n) 9 #define SCAN2(a,b) scanf("%d%d",&a,&b)10 #define SCANS(s) 阅读全文
posted @ 2013-07-12 09:54 parryworld 阅读(173) 评论(0) 推荐(0) 编辑