摘要:
hdu 4267 A Simple Problem with Integers http://acm.hdu.edu.cn/showproblem.php?pid=4267多个树状数组,区间跟新,单点询问,转化为单点更新,求和View Code 1 #include <cstdio> 2 #include <cstring> 3 using namespace std; 4 5 const int N=50010; 6 int c[11][10][N]; 7 int a[N]; 8 int lowbit(int x) 9 {10 return x&(-x);11
阅读全文
posted @ 2012-11-30 20:39
Qiuqiqiu
阅读(91)
推荐(0)
编辑
摘要:
hdu 4366 Successor http://acm.hdu.edu.cn/showproblem.php?pid=4366 2012-12-9题意:给你一棵树,每个节点有能力值(abi)和忠诚值(val),询问一个节点,它的后代中能力值大于它,忠诚值最大的节点遍历树,树状结构转换为线性结构,区间求max(val),abi>k,类似离线算法,先按abi排序,一个一个插入View Code 1 #include <cstdio> 2 #include <vector> 3 #include <cstring> 4 #include <algo
阅读全文
posted @ 2012-11-30 17:22
Qiuqiqiu
阅读(190)
推荐(0)
编辑