Codeforces 460C Present 二分+前缀和
点击打开链接题意:n个数,m次操作 n,m二分最值x,判定:res为a[i]过去被累加次数,显然res=[a[i-w+1]~a[i-1]]被累加的次数之和,利用前缀和b[i]记录前i个数累加之和即可求出res 若a[i]+res#include using namespace std;typedef long long ll;const int N=2e5+20;l