摘要:
http://www.zybbs.org/JudgeOnline/problem.php?id=1878树状数组+离线算法因为不需要在线更新结点所以想到离线算法速度更快难点在于相同颜色的算一个,所以要灵活运用树状数组用next记录每个点后面的第一个颜色相同的点按左区间排序i:1->n不断更新updata(next[i])到了其中一个的左区间就更新最后还原排序下View Code #include<iostream>#include<algorithm>#include<cstdio>#include<string.h>using names 阅读全文
posted @ 2011-11-19 23:10 huhuuu 阅读(711) 评论(0) 推荐(0)
浙公网安备 33010602011771号