随笔分类 -  树状数组

摘要:#include<bits/stdc++.h> using namespace std; const int N=1e6+10; int a[N]; int n; int tr[N]; int f[N]; int ans; int lowbit(int x) { return x&-x; } voi 阅读全文
posted @ 2020-05-25 20:33 晴屿 编辑
摘要:``` #include using namespace std; typedef long long ll; typedef unsigned long long ull; const int maxn = 1e6; int col[maxn]; int num[maxn]; int vis[maxn]; int idx,h[maxn],e[maxn],ne[maxn]; int tl[maxn 阅读全文
posted @ 2020-02-28 22:56 晴屿 编辑
摘要:和Disharmony Trees HDU - 3015神似 // max(vi,vj) * |posi - posj| #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; typedef lon 阅读全文
posted @ 2020-02-09 21:54 晴屿 编辑
摘要:#include<iostream> #include<cstring> using namespace std; const int N = 100005; int tr[N]; int lowbit(int x) { return x&(-x); } void add(int x,int a) 阅读全文
posted @ 2020-02-09 21:38 晴屿 编辑
摘要:#include<cstdio> #include<cstring> #include<algorithm> #define ll long long using namespace std; struct node { ll x,h; } Tr[100005]; int n,tr1[100005] 阅读全文
posted @ 2020-02-09 21:23 晴屿 编辑
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; typedef long long ll; const int N=1e5+10; int a[N]; int 阅读全文
posted @ 2020-02-09 19:50 晴屿 编辑
摘要://每个数字只会被它后面的比它小的数字影响,且会向右移动相应个数的位置 //比如:6 4 3 5 2 1 。4后面比它小的有 三个,因此它的最右边位置就是当前位置 +3,即5 //如果该数字本身在标准位置左边,那无须考虑,初始位置就是最左端 //如果它在标准位置右边,我们可以知道,它最终肯定要回到标 阅读全文
posted @ 2020-02-09 19:28 晴屿 编辑
摘要:#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; const int N=5e5+10; int n; int a[ 阅读全文
posted @ 2020-02-08 23:32 晴屿 编辑
摘要:#include<cstdio> #include<cstring> using namespace std; typedef long long ll; const ll mod=1e9+7; const int N=1005; ll c[N][N]; char op[5]; int lowbit 阅读全文
posted @ 2020-02-08 22:54 晴屿 编辑
摘要:#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; const int N=32005; int a[N]; int tr[N]; int level[N]; i 阅读全文
posted @ 2020-02-08 22:46 晴屿 编辑
摘要:#include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N=100010; int a[N]; int tr[N]; int n,m; int l,r; int lowbit(in 阅读全文
posted @ 2020-02-08 22:34 晴屿 编辑
摘要:#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long LL; const int N = 50005; int n; i 阅读全文
posted @ 2020-02-08 19:24 晴屿 编辑

点击右上角即可分享
微信分享提示