
树状数组
SYaoJun
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
4316. 合适数对【离散化+树状数组】
离散化+树状数组原创 2022-03-21 08:25:03 · 436 阅读 · 0 评论 -
1027 Larry and Inversions (35 分)
树状数组原创 2022-02-27 17:22:23 · 222 阅读 · 0 评论 -
树状数组【模板题】三连
基础版 题目链接 单点更新 求区间 注意 数组大小:20000 数据范围:用long long 格式:每个结果输出后加换行符 #include <iostream> #include <cstring> using namespace std; // 前缀和 差分 二分 树状数组 const int N = 2e5+6; int n, m; typedef long long LL; LL a[N], tr[N]; int lowbit(int x){ return x&原创 2021-08-01 00:20:13 · 140 阅读 · 0 评论 -
L3-002 特殊堆栈 (30 分)
题目链接 知识点: lower_bound(begin, end, value)大于等于value的迭代器位置 版本1 有序向量 #include <iostream> #include <string> #include <algorithm> #include <stack> #include <vector> using names...原创 2019-11-17 11:48:08 · 603 阅读 · 0 评论 -
树状数组
树状数组——解决动态前缀和问题的数据结构 //树状数组下标必须从1开始 #include<cstdio> const int maxn = 1e+5; int C[maxn],A[maxn]; int n; int lowbit(int x){ return x&(-x); } int query(int x){ //查询A[x]前面的和 int res=0; ...原创 2019-02-14 15:46:46 · 168 阅读 · 0 评论 -
P3374 【模板】树状数组 1
树状数组 #include <cstdio> #include <iostream> #include <vector> #include <string> #include <set> #include <cstring> #include <algorithm> using namespace std; co...原创 2019-09-10 23:15:44 · 252 阅读 · 0 评论 -
P3368 【模板】树状数组 2
差分数组的树状数组 #include <cstdio> #include <iostream> #include <vector> #include <string> #include <set> #include <cstring> #include <algorithm> typedef long long L...原创 2019-09-11 08:43:45 · 132 阅读 · 0 评论 -
1010 Lehmer Code (35 分)
树状数组原创 2019-09-11 15:36:48 · 303 阅读 · 0 评论