- 博客(7)
- 资源 (5)
- 收藏
- 关注
原创 POJ 3264 Balanced Lineup,RMQ
求区间的最大值,最小值的差值。 RMQ问题 1、Sparse-Table算法,预处理时间O(nlogn),查询时间O(1) 2、线段树(略) ST算法 #include #include #include using namespace std; const int maxn = 50005; int ST_min[maxn][30], ST_max[maxn][30];
2014-01-18 22:35:52 1701
原创 hdu1754 I Hate It
用线段树维护区间最大值,支持修改单点的值。 #include #include #include using namespace std; #define LL(x) (x<<1) #define RR(x) (x<<1|1) const int maxn = 200005; struct node { int l, r; int Max; }tree[maxn*4]
2014-01-18 17:56:52 1902
原创 hdu1394 Minimum Inversion Number
求Inversion的最小逆序数 先用线段树求出初序列的逆序数, 然后 每次将最后一个数,移到第一个位置 逆序数的变化 减少a[i], 增加n - 1 - a[i] 记录最小逆序数 update:单点增减 query:区间求和 #include #include using namespace std; #define LL(x) (x<<1) #define R
2014-01-18 17:54:08 1895
原创 hdu1556 Color the ball
Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a 简单的区间修改,单点统计。 1、离散化 ; 2、树状数组; 3、线段树 1、离散化 #include #include #define MAXN 100000 + 5 int bit[MAXN]; int m
2014-01-15 10:33:21 2020
原创 poj2352 Stars
简单的区间统计, 一定要注意 i可以为0的情况的存在!! (树状数组) #include #include #define N 15000 + 10 int c[32000+10]; int n, Max; inline int lowbit(int x) {return (x&-x);} void modify(int i,int d) {for(; i<=Max+1; i+=lowb
2014-01-13 14:36:49 1799
原创 hoj 2275 Number sequence(树状数组)
题意问你在序列中有多少个这样的关系式:ai ak (i 两次使用树状数组。 注意:ai可以为0!! /*This Code is Submitted by yew1eb for Problem 2275 at 2014-01-13 11:14:55*/ #include #include #define MAXA 32768 #define MAXN 50000 +
2014-01-13 11:19:55 1911
《Streaming Systems》 英文版 完整版
2018-10-11
hadoop-common-2.2.0-bin_32bit_&_64bit
2015-05-19
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人