题目传送门 1 /* 2 线段树-成段更新:裸题,成段增减,区间求和 3 注意:开long long:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 using namesp...
分类:
其他好文 时间:
2015-05-16 10:26:40
阅读次数:
104
题目传送门 1 /* 2 线段树-成段更新:第一题!只要更新区间,输出总长度就行了 3 虽然是超级裸题,但是用自己的风格写出来,还是很开心的:) 4 */ 5 #include 6 #include 7 #include 8 #include 9 #incl...
分类:
其他好文 时间:
2015-05-15 21:12:52
阅读次数:
112
题目传送门 1 #include 2 #include 3 #define lson l, m, rt > 1;23 build (lson);24 build (rson);25 }26 27 int update(int p, int l, int r, int rt)28 ...
分类:
其他好文 时间:
2015-05-15 19:53:15
阅读次数:
118
题目传送门 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int MAX_N = 100000 + 10; 7 int cnt[MAX_N]; 8 int ans[MAX_N]; 9 in...
分类:
编程语言 时间:
2015-05-15 19:52:47
阅读次数:
159
题目传送门 1 #include 2 #include 3 #define lson l, m, rt > 1 % 5 == 3)12 sum[rt] += sum[rt >> 1];13 if (rt >>1 | 1 % 5 == 3)14 sum[rt...
分类:
其他好文 时间:
2015-05-15 19:49:00
阅读次数:
140
题目传送门 1 /* 2 结点存储下面有几个空位 3 每次从根结点往下找找到该插入的位置, 4 同时更新每个节点的值 5 */ 6 #include 7 #define lson l, m, rt > 1;21 build (lson);22 build (...
分类:
其他好文 时间:
2015-05-15 19:47:21
阅读次数:
145
题目传送门 1 /* 2 线段树基本功能:区间最大值,修改某个值 3 */ 4 #include 5 #include 6 #include 7 #define lson l, m, rt > 1;32 build (lson);33 build (rson);34 ...
分类:
其他好文 时间:
2015-05-15 19:43:59
阅读次数:
102
题目传送门 1 /* 2 线段树基本功能:区间值的和,修改某个值 3 */ 4 #include 5 #include 6 #define lson l, m, rt > 1;25 build (lson);26 build (rson);27 pushup (r...
分类:
编程语言 时间:
2015-05-15 19:29:18
阅读次数:
133
题目传送门 1 /* 2 主要利用线段树求区间最值,sum[]代表位置可用空间 3 每次找到最大值的位置 4 功能:查询最靠前能容纳广告的位置 5 */ 6 #include 7 #include 8 #include 9 #define lson l, m, rt >...
分类:
其他好文 时间:
2015-05-15 19:18:33
阅读次数:
123
传送门在这里
题意:求Sum(C[i][j]) (x1
思路:由c[i][j]=c[i-1][j-1]+c[i-1][j]可知Sum(C[i][k]) = C[b+1][k+1]-C[a][k+1] (a
Lucas定理:C[n][m]%p=C[n/p][m/p]*C]n%p][m%p]%p
令a=n%p,b=m%p,
则C[a][b]=a!/(b!*(a-b)!)
由于b!*(a-b...
分类:
其他好文 时间:
2015-05-15 17:49:41
阅读次数:
114