基本上敲的模板功能:区间更新,区间查询自己随意开发。。 1 #include "iostream" 2 using namespace std; 3 #define lson l,m,rt>1)) * p[rt];23 sum[rt> 1) * p[rt];24 p[...
分类:
其他好文 时间:
2014-12-30 01:40:57
阅读次数:
179
通过参考大神们的文章,准备开始要一个一个把上面的题目做一遍了,有很多都是原来做过的,现在也再次做一遍方便以后查阅HDU 1166 敌兵布阵单点增减,区间和查询线段树:#include #include using namespace std;const int N = 50005;#define l...
分类:
其他好文 时间:
2014-12-29 22:45:08
阅读次数:
252
SWUN 1749
题目链接
思路:lis一样的状态转移方程,不过要利用线段树去维护,每次更新到i,相应的维护i - d之后的区间的最大值,不断转移即可
代码:
#include
#include
#include
using namespace std;
#define lson(x) ((x<<1)+1)
#define rson(x) ((x<<1)+2)
...
分类:
其他好文 时间:
2014-12-29 16:57:04
阅读次数:
162
HDU 5151 Sit sit sit
题目链接
区间DP+组合计数问题,转移方程为,每次选当前区间最后一个放的位置,然后乘上组合数C[区间长度][左区间长度]
代码:
#include
#include
typedef long long ll;
const ll MOD = 1000000007;
const int N = 105;
int n, a[N];
ll ...
分类:
其他好文 时间:
2014-12-29 16:56:35
阅读次数:
99
题目大意:维护一个序列,支持以下操作:
1.在某个位置插入一个数
2.删除某个位置上的数
3.修改某个位置上的数
4.求某段区间中的次大值与区间中另一个数的异或值的最大值
强制在线
替罪羊树套Trie树。。。终于尼玛A了。。。7.4KB的大代码啊- -
插入和修改同带插入区间k小值 删除要打标记不能直接删
删除的时候注意 删除导致的不平衡不要重建 否则复杂度无法保证
因此每个节点...
分类:
其他好文 时间:
2014-12-29 15:26:35
阅读次数:
119
最近打开了一个好久没用的myeclipse 8.5下的工作区间,导入一个项目,想打开文件编辑提示Could not open the editor: Invalid thread access解决办法:1:cmd 进入myeclipse的安装目录 找到myeclipse.exe所在位置目录2:执行m...
分类:
数据库 时间:
2014-12-29 10:16:52
阅读次数:
281
Description You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to eac....
分类:
其他好文 时间:
2014-12-28 23:31:26
阅读次数:
235
1. (1)\[ \mbox{原式}= 2 + \int_{-1}^1 2x \sqrt{1-x^2} dx= 2- (1-x^2)^{3/2}\bigg|_{-1}^{1}=2.\](第二个积分根本不需要算,注意到它时对称区间以及奇函数)(2)\[ \int_{\frac{1}{\sqrt ...
分类:
其他好文 时间:
2014-12-28 23:30:18
阅读次数:
319
Description: In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several cons...
分类:
其他好文 时间:
2014-12-28 22:01:51
阅读次数:
212
1.算法描述
快速排序是一种基于分治技术的排序算法。在一个给定的数列中,选择一个数作为分区的依据进行排序,使得数的左边都小于该数,数的右边都大于该数,然后将该数的左边和右边分别作为一个数列进行排序,一直重复以上操作,直到分区里只有一个数字为止。
上面所说的是快速排序的基本特点,可以简单总结为:确定分区依据,左小右大(或左大右小),划分子区间,重复以上操作,直到子区间只有一个数字。
在具体的实...
分类:
编程语言 时间:
2014-12-28 19:36:01
阅读次数:
237