![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_线段树
DATELOST
I'm curious.
展开
-
HDU-1166 树状数组,zkw线段树
Input 第一行一个整数T,表示有T组数据。 每组数据第一行一个正整数N(N<=50000),表示敌人有N个工兵营地,接下来有N个正整数,第i个正整数ai代表第i个工兵营地里开始时有ai个人(1<=ai<=50)。 接下来每行有一条命令,命令有4种形式: (1) Add i j,i和j为正整数,表示第i个营地增加j个人(j不超过30) (2)Sub i j ,i和j为正整数,表...原创 2019-02-16 22:51:19 · 251 阅读 · 0 评论 -
HDU-1754 zkw线段树 单点更新 最大值
Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0&lt;N&lt;...原创 2019-03-03 22:53:06 · 183 阅读 · 0 评论 -
HDU-1394 zkw线段树 逆序数
Problem Description The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i &amp;lt; j and ai &amp;gt; aj. For a given sequence of numbers a1, a2, …, an, i...原创 2019-03-04 15:51:02 · 139 阅读 · 0 评论 -
HDU-1698 线段树 区间修改
Problem 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 consecutive metallic sticks which are of the same ...原创 2019-03-14 23:33:12 · 163 阅读 · 0 评论 -
P3178 树链剖分 线段树 子树加
题目 输入样例#1: 5 5 1 2 3 4 5 1 2 1 4 2 3 2 5 3 3 1 2 1 3 5 2 1 2 3 3 输出样例#1: 6 9 13 说明 对于 100% 的数据, N,M<=100000 ,且所有输入数据的绝对值都不会超过 10^6 因为子树的dfs序连续,所以直接区间加pos[u]+siz[u]-1,便可实现子树加; #include<bits/stdc+...原创 2019-07-22 14:08:47 · 141 阅读 · 0 评论