线段树
文章平均质量分 77
hlssbird
这个作者很懒,什么都没留下…
展开
-
hdu 1394 Minimum Inversion Number 线段树求逆序数
线段树求逆序数 题意:给你一个串数字,数字串第一个依次循环放到最后一个,求每个数字串的逆序数的最小值。 如如: 0 3 4 1 2 逆序数:8 3 4 1 2 0 逆序数:8 4 1 2 0 3 逆序数:6 1 2 0 3 4 逆序数:2 2 0 3 4 1 逆序数:4 所以最小逆序数为2原创 2016-07-06 08:45:05 · 402 阅读 · 0 评论 -
hdu 1166 敌兵布阵
线段树的区间更新 详情见代码: #include #include #include #include #define maxn 100100 using namespace std; int sto[maxn<<1]; int up[maxn<<1]; void Insert(int left,int right,int o) { up[o]=0; if(left==righ原创 2016-07-05 18:54:52 · 248 阅读 · 0 评论 -
hdu 1754 I Hate It
线段树的单点更新 详情请见代码: #include #include #include #include #include #define maxn 200100 using namespace std; int sto[maxn<<2]; int up[maxn<<2]; void Insert(int left,int right,int o) { up[o]=0; if(原创 2016-07-05 18:46:29 · 283 阅读 · 0 评论