正文
增加 7 行删除 7 行
78 行未改动79808182838485868712 行未改动10010110210310410510610710810 行未改动11912012112212312412512612743 行未改动1711721731741751761771781793 行未改动18318418518618718818919019116 行未改动20820921021121221321421521646 行未改动26326426526626726826927027178 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}```12 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}```10 行未改动设 $\operatorname{cur}$ 为当前生命值 ,能撑住 $\operatorname{k}$ 个一整轮攻击更新 $\operatorname{tot}$ :加上当前增加的值即可接着让 $\operatorname{cur}$ 不断减去 $\operatorname{pow2}_{x} * \operatorname{tot}$ (即每轮翻倍后的一轮攻击值总和),直到 $\operatorname{pow2}_{x} * \operatorname{tot}$ 大于 $\operatorname{cur}$ ,减一次就让 $\operatorname{k} + 1$```cpptot+=(r-l+1)*d;43 行未改动cur-=(a[j]+lazy[b])*pow2[k];if(cur>0)ans++;else break;}cout<<ans<<'\n';```---3 行未改动```cpp#include<bits/stdc++.h>using namespace std;const int N=1e6+10;//记得开long longint n,q;long long w,tot,lazy[N],sum[N];int a[N];int block,t;16 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}int main(){ios::sync_with_stdio(false);46 行未改动cur-=(a[j]+lazy[b])*pow2[k];if(cur>0)ans++;else break;}cout<<ans<<'\n';}return 0;}```78 行未改动79808182838485868712 行未改动10010110210310410510610710810 行未改动11912012112212312412512612743 行未改动1711721731741751761771781793 行未改动18318418518618718818919019116 行未改动20820921021121221321421521646 行未改动26326426526626726826927027178 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}```12 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}```10 行未改动设 $\operatorname{cur}$ 为当前生命值 ,能撑住 $\operatorname{k}$ 个一整轮攻击更新 $\operatorname{tot}$ :加上当前增加的值即可接着让 $\operatorname{cur}$ 不断减去 $\operatorname{pow2}_{x} * \operatorname{tot}$ (即每轮翻倍后的一轮攻击值总和),直到 $\operatorname{pow2}_{x} * \operatorname{tot}$ 大于 $\operatorname{cur}$ ,减一次就让 $\operatorname{k} + 1$```cpptot+=(r-l+1)*d;43 行未改动cur-=(a[j]+lazy[b])*pow2[k];if(cur>0)ans++;else break;}cout<<ans<<'\n';```---3 行未改动```cpp#include<bits/stdc++.h>using namespace std;const int N=1e6+10;//记得开long longint n,q;long long w,tot,lazy[N],sum[N];int a[N];int block,t;16 行未改动for(int i=p+1;i<q;i++)lazy[i]+=d;for(int i=l;i<=ed[p];i++)a[i]+=d;sum[p]+=(ed[p]-l+1)*d;for(int i=st[q];i<=r;i++)a[i]+=d;sum[q]+=(r-st[q]+1)*d;}}int main(){ios::sync_with_stdio(false);46 行未改动cur-=(a[j]+lazy[b])*pow2[k];if(cur>0)ans++;else break;}cout<<ans<<'\n';}return 0;}```