POJ 3468
摘要:线段树---->成段更新虽然对代码有调试,理解,但是可能注释也不一定对。。总之就是线段树学的太水了。。递归思想也不太清楚啊。哭死PS:大牛勿喷,弱菜贴代码只是为了以后查看 T T 1 //该题与hdu1166的敌兵布阵不同在于,该题是成段更新,而敌兵布阵是单点更新 2 #include <iostream> 3 #include <cstdio> 4 #include <cstring> 5 #include <algorithm> 6 #define lmax x<<1 7 #define rmax x<<1|1
阅读全文
线段树完整版(转载)
摘要:转载出处:http://www.notonlysuccess.com/index.php/segment-tree-complete/
阅读全文
POJ 1101
摘要:搜索题: 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <queue> 5 #include <algorithm> 6 using namespace std; 7 8 int n, m; 9 char MAP[550][550]; 10 int turn[550][550]; //记录每个点的最少转弯次数 11 int dir[4][2] = {{-1, 0},{1, 0},{0, 1},{0, -1}}; 12 int x_1,
阅读全文