随笔分类 - 线段树&&树状数组
摘要:题目链接:hiho1080 直接看代码吧,两个标记分开处理 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 #define mod 1000000007 5 #define pi (4*atan(1.
阅读全文
摘要:题目连接:HDU - 5091 比较少写这类问题,要多练习。。, 参考:http://www.cnblogs.com/tsw123/p/4470115.html
阅读全文
摘要:题目连接:https://vjudge.net/problem/UVALive-4329 lowbit..
阅读全文
摘要:题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1542 又看到了几个月前做的题,感觉那时候就是个sb 也怪自己刚开始没搞清楚线段树,,瞎摸索 用连续线段树很好理解这个题,之前的代码稍微改了一下就好理解多了 1 #include<cstdio> 2 #i
阅读全文
摘要:题目链接: https://scut.online/problem.php?id=85 组队赛的一道题。。 大概整场就写了这一道题吧。。。。。。。 一路坑到死。。。。 首先是线段树写的存在很多问题,然后是取模也WA几次orz 放代码吧,吸取教训!! 不过最后总算过了还是有点小激动,毕竟是第一次在场上
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795 单点更新??
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 n-1-x[i]是x[i]后面比x[i]大的数的个数,x[i]是x[i]后面比[i]小的数的个数
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4027 区间(单点)更新,区间求和。
阅读全文
摘要:题目链接:http://poj.org/problem?id=3264 查找区间最值,做差。 刚学了RMQ,方便很多。。。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 区间更新,区间求和。
阅读全文
摘要:题目链接:http://poj.org/problem?id=2528 区间覆盖。 离散化(有点特殊的离散化)。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #define lson l,m,rt<<1 5 #defi
阅读全文
摘要:题目链接:http://poj.org/problem?id=3468 区间更新,区间求和。
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754 单点更新,查找区间最大值。
阅读全文
摘要:详细讲解线段树:http://blog.csdn.net/metalseed/article/details/8039326 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166 单点更新,区间求和。
阅读全文

浙公网安备 33010602011771号