简单题不简单-- 我们把单点加操作改成插入一个权值为增加量的点,将问题转化成询问一个矩阵中所有点的和,用 \(K-D\ Tree\) 维护,时间复杂度 \(O(n\sqrt{n})\) \(Code\ Below:\) // luogu-judger-enable-o2 #include <bits/stdc++.h> using namespace std; const int maxn=500000+10; const double alpha=0.75; int n,D,rt,cnt,t…