树状数组

L如果你害怕失敗,那你很有可能會失敗。 If you’re afraid to fail, then you’re probably going to fail. 树状数组 cpp #include <iostream> using namespace std; #define _rep(i,a,b) for(int i=(a);i<=(b);++i) #define _for(i,a,b) for(int i=(a);i<(b);++i) inline int readint(){int x;scanf("%d",&x);return x;} const int MAXN=5e5+5; int tree[MAXN]; int n,m; inline int lowbit(int x){return x&-x;} void add(int x,int d){while(x<=n){tree[x]+=d;x+=lowbit(x);}} int

线段树

L如果你害怕失敗,那你很有可能會失敗。 If you’re afraid to fail, then you’re probably going to fail. 线段树模版 cpp #include <iostream> using namespace std; #define _rep(i,a,b) for(int i=(a);i<=(b);++i) #define _for(i,a,b) for(int i=(a);i<(b);++i) inline int readint(){int x;scanf("%d",&x);return x;} const int MAXN=1e5 +10; long long sum[4*MAXN]; long long add[4*M

线性表P19综合题(1)

L如果你害怕失敗,那你很有可能會失敗。 If you’re afraid to fail, then you’re probably going to fail. 线性表P19综合题(1) 01从顺序表中删除具有最小值的元素(假设唯一)并由函数返

数据结构开篇(helloworld)

L如果你害怕失敗,那你很有可能會失敗。 If you’re afraid to fail, then you’re probably going to fail. 数据结构开篇 cpp #include <iostream> int main(){ std::cout<<"helloworld"<<std::endl; return 0; }