ref不是太懂 #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef unsigned long long ull; int T, n, m, hea[1000005], cnt, uu, vv, rnd[1000005], rot, siz[1000005]; int tot, sf[1000005], sg[1000005], ff[1000005]…
学了斜率优化这题就能一气呵成地做出来啦qwqqwq #include <iostream> #include <cstdio> using namespace std; typedef long long ll; int n, m, x[3005], s[3005], l, r, dp[3005][3005], que[3005]; double getK(int j, int u, int v){ return (double)(dp[v][j-1]+s[v]*s[v]-(dp[…
做了 [JSOI2008]Blue Mary开公司 以后发现这 tm 不就是个傻逼树剖+李超线段树吗,做了以后发现我才是傻逼--树剖竟然写错了--这题是我目前写过最长的代码了qwq #include <iostream> #include <cstdio> using namespace std; typedef long long ll; int n, m, uu, vv, ww, dep[100005], fa[100005], dfn[100005], son[100005]…
there #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef long long ll; int T, n, m, pri[1000005], pricnt, mu[1000005], f[1000005], g[1000005], F[1000005]; bool isp[1000005]; const int mod=1000000007; te…