版本比较
di1236
正文
增加 17 行删除 17 行
1234567891011121345678910111213141516179 行未改动2728293031313233343548 行未改动8485868788888990919217 行未改动110111112113114114115116117118320 行未改动全部展开439440441442443443444445446447558 行未改动全部展开100610071008100910101010101110121013101429 行未改动104410451046104710481048104910501051105212 行未改动106510661067106810691069107010711072107321 行未改动:::info[测试电脑]```cpp#pragma GCC optimize(0)#include<iostream> #include<cstdio> #include<cstdlib> #include<ctime> #include<fstream> #include<algorithm> #include<map> #include<queue> #include<deque> #include<set> #include<iostream>#include<cstdio>#include<cstdlib>#include<ctime>#include<fstream>#include<algorithm>#include<map>#include<queue>#include<deque>#include<set>#include<vector>#define ll long long#define lf double#define ld long double9 行未改动 tot2+=tot; } cout<<tot2/3; return 0;} }
```:::
48 行未改动 if(a==1) add(x,k); else sum(x,k); } return 0;} }```:::::
:::::info[线段树]17 行未改动 s[2*now+1].w+=s[now].add*(s[2*now+1].r-s[2*now+1].l+1); s[2*now].add+=s[now].add;s[2*now+1].add+=s[now].add; s[now].add=0; }} }void build(int now,int l,int r){ s[now]=(node){l,r,a[l],0}; if(l==r) return; int mid=l+r>>1;320 行未改动全部展开 else if(op==2) erase(root,x); else if(op==3) cout<<key_to_rank(root,x)-1<<'\n'; else if(op==4) cout<<rank_to_key(root,x+1)<<'\n'; else if(op==5) cout<<last(root,x)<<'\n'; else cout<<next(root,x)<<'\n'; else cout<<next(root,x)<<'\n'; } return 0;}```558 行未改动全部展开
:::::warning[高精度]```cppstruct bigint{ int a[100],len;//这里没写正负性 int a[100],len;//这里没写正负性 bigint(int x=0){ memset(a,0,sizeof(a)); for(len=1;x;len++) a[len]=x%10,x/=10;29 行未改动 c.a[i]=a.a[i]+b.a[i]; c.flatten(len+1); return c;}bigint operator - (bigint a,bigint b){//在这里默认a>b bigint operator - (bigint a,bigint b){//在这里默认a>b bigint c; int len=a.len; for(int i=1;i<=len;i++){ c.a[i]=a.a[i]-b.a[i];12 行未改动 c.flatten(len); return c;}bigint operator / (bigint a,bigint b){//整除 //略 //略}```:::::
21 行未改动