04 2018 档案

摘要:"ref" cpp include include include include using namespace std; typedef long long ll; int n, q, a[100005], l[100005], r[100005], sta[100005], din, blc, 阅读全文
posted @ 2018-04-30 13:59 poorpool 阅读(204) 评论(0) 推荐(0)
摘要:好像复杂度来说不是正解……不加谜之优化(下叙)能被loj上的加强数据卡 cpp include include include include using namespace std; int n, m, hea[100005], cnt, uu[200005], fa[100005], siz[1 阅读全文
posted @ 2018-04-27 21:03 poorpool 阅读(223) 评论(0) 推荐(0)
摘要:这竟然是一道分块题…… cpp include include include include using namespace std; int n, m, q, blc, qnt, fa[50005], mxa[50005], mxb[50005], sz[50005], bcj, ans[500 阅读全文
posted @ 2018-04-27 16:14 poorpool 阅读(257) 评论(0) 推荐(0)
摘要:大傻逼trie树,更傻逼的是我这都没独立想出来,以后要少看题解,多多思考 阅读全文
posted @ 2018-04-26 21:33 poorpool 阅读(194) 评论(0) 推荐(0)
摘要:CQOI 板子大赛之 pollard rho cpp include include using namespace std; typedef long long ll; ll e, N, c, jzm, p, q, r, d, n; ll gcd(ll a, ll b){ return !b?a: 阅读全文
posted @ 2018-04-26 20:20 poorpool 阅读(174) 评论(0) 推荐(0)
摘要:k d tree 裸题……………… cpp include include include using namespace std; typedef long long ll; int n, k, rot, nowD, din; ll dui[205]; const ll oo=9e18; stru 阅读全文
posted @ 2018-04-26 15:17 poorpool 阅读(211) 评论(0) 推荐(0)
摘要:题面不符?…… cpp include include include using namespace std; typedef long long ll; int n, m, nowD, rot, din, kk; const ll oo=9e18; struct Point{ int d[2], 阅读全文
posted @ 2018-04-26 11:06 poorpool 阅读(176) 评论(0) 推荐(0)
摘要:k d tree + 重构的思想,就能卡过luogu和bzoj啦orz cpp include include include using namespace std; int n, m, rot, nowD, opt, uu, vv, ans, rub[1000005], din, cur; co 阅读全文
posted @ 2018-04-26 08:53 poorpool 阅读(167) 评论(0) 推荐(0)
摘要:分治+最小割 看到题解的第一句话是这个就秒懂了,然后乱七八糟的错误、越界、RE…… cpp include include include include include include using namespace std; int n, m, uu, vv, ww, hea[855], cnt 阅读全文
posted @ 2018-04-25 16:18 poorpool 阅读(178) 评论(0) 推荐(0)
摘要:学了斜率优化这题就能一气呵成地做出来啦qwqqwq cpp include include using namespace std; typedef long long ll; int n, m, x[3005], s[3005], l, r, dp[3005][3005], que[3005]; 阅读全文
posted @ 2018-04-25 09:51 poorpool 阅读(208) 评论(0) 推荐(0)
摘要:"大米饼写的太棒辣qwqqwq" cpp include include using namespace std; typedef long long ll; int n, l, r, que[1000005]; ll x[1000005], p[1000005], c[1000005], dp[1 阅读全文
posted @ 2018-04-24 21:55 poorpool 阅读(105) 评论(0) 推荐(0)
摘要:懒得写 cpp include include using namespace std; typedef long long longlivetheelder; int n, l, ll, rr, que[50005]; longlivetheelder w[50005], dp[50005]; s 阅读全文
posted @ 2018-04-24 21:10 poorpool 阅读(112) 评论(0) 推荐(0)
摘要:被 bs 了姿势水平……好好学习数学QAQQAQQAQ "ref" cpp include include include using namespace std; typedef long long ll; int n, m, pri[10000005], cnt, mu[10000005], q 阅读全文
posted @ 2018-04-23 21:09 poorpool 阅读(127) 评论(0) 推荐(0)
摘要:"ref" cpp include include include using namespace std; int nn, n, rnk[60005], tmp[60005], cnt[60005], m=128, p, saa[60005]; char s[15], ss[60005]; voi 阅读全文
posted @ 2018-04-23 19:35 poorpool 阅读(126) 评论(0) 推荐(0)
摘要:"ref" cpp include include include include using namespace std; typedef long long ll; int n, m, a[2005], b[2005]; ll dp[2005][2005]; ll f(){ memset(dp, 阅读全文
posted @ 2018-04-22 20:42 poorpool 阅读(120) 评论(0) 推荐(0)
摘要:越靠近叶子越优先删掉 阅读全文
posted @ 2018-04-21 10:28 poorpool 阅读(149) 评论(0) 推荐(0)
摘要:做了 [JSOI2008]Blue Mary开公司 以后发现这 tm 不就是个傻逼树剖+李超线段树吗,做了以后发现我才是傻逼……树剖竟然写错了……这题是我目前写过最长的代码了qwq cpp include include using namespace std; typedef long long 阅读全文
posted @ 2018-04-21 09:24 poorpool 阅读(230) 评论(0) 推荐(0)
摘要:"ref" 好像叫什么李超线段树?……这篇不是太通用…… 阅读全文
posted @ 2018-04-20 15:13 poorpool 阅读(141) 评论(0) 推荐(0)
摘要:跑最大费用最大流,注意到每次 spfa 出来的 cost 一定是越来越少的,啥时小于 $0$ 了就停了吧。 cpp include include include include using namespace std; typedef long long ll; int n, a[205], b[ 阅读全文
posted @ 2018-04-20 09:42 poorpool 阅读(212) 评论(0) 推荐(0)
摘要:"ref" "ref" 一个点就是一个数对 $(x,y)$。 记状态 $f[i][1/0][1/0][1/0]$ 和 $g[i][1/0][1/0][1/0]$,其中三个 $1/0$ 取值分别代表“$x$ 在前 $i$ 位卡满 $n$(的前 $i$ 位)/小于它”、“$y$ 在前 $i$ 位卡满 $ 阅读全文
posted @ 2018-04-19 21:37 poorpool 阅读(172) 评论(0) 推荐(0)
摘要:定义区间是内部只含有乘号的区间。 对于区间左端点是 $l \geq 2$ 的情况,左端点前头是加号的情况和前头是减号的情况的个数是相同的。因此这些区间不对答案产生贡献。 所以区间左端点必定是 $1$。当 $r=n$ 时,这个区间产生一次贡献。当 $r include include using na 阅读全文
posted @ 2018-04-19 16:57 poorpool 阅读(123) 评论(0) 推荐(0)
摘要:矩阵树定理+模意义下整数高斯消元 cpp include include include include include using namespace std; typedef long long ll; typedef pair pii; int n, uu, vv, ww, w[21][21] 阅读全文
posted @ 2018-04-19 16:05 poorpool 阅读(194) 评论(0) 推荐(0)
摘要:欲学矩阵树定理~~必先自宫~~学习 "一些行列式的姿势" 然后 "做一道例题" 阅读全文
posted @ 2018-04-19 15:24 poorpool 阅读(115) 评论(0) 推荐(0)
摘要:"orz" cpp include include using namespace std; typedef long long ll; int n, m, k, C[105][105], u[105], r[105], g[105]; const int mod=1e9+7; int ksm(in 阅读全文
posted @ 2018-04-19 13:58 poorpool 阅读(301) 评论(0) 推荐(0)
摘要:"too hard" cpp include include using namespace std; int n, d, m, uu, vv, hea[500005], cnt, w[500005], f[500005][22], g[500005][22]; bool vis[500005]; 阅读全文
posted @ 2018-04-19 07:59 poorpool 阅读(269) 评论(0) 推荐(0)
摘要:trie 树思想运用到主席树上 "orz" cpp include include using namespace std; int n, m, a[200005], cnt, rot[200005], bb, xx, uu, vv; struct Node{ int l, r, sum; }nd[ 阅读全文
posted @ 2018-04-18 18:46 poorpool 阅读(181) 评论(0) 推荐(0)
摘要:神tm st表+并查集 cpp include include include using namespace std; typedef long long ll; int n, m, a, b, c, d, fa[19][100005]; const int mod=1000000007; int 阅读全文
posted @ 2018-04-17 20:54 poorpool 阅读(184) 评论(0) 推荐(0)
摘要:点分治+线性基 (为了这六个字窝调了一下午一晚上QAQ cpp include include include include include using namespace std; typedef long long ll; int n, uu, vv, m, hea[20005], cnt, 阅读全文
posted @ 2018-04-17 19:54 poorpool 阅读(201) 评论(0) 推荐(0)
摘要:"……" cpp include include include include include using namespace std; typedef pair par; typedef long long ll; int s[510005][26], n, len, cnt, idx[5100 阅读全文
posted @ 2018-04-17 10:12 poorpool 阅读(183) 评论(0) 推荐(0)
摘要:真的是裸背包啊…… cpp include include using namespace std; typedef long long ll; int n, k[125], c[125], sum[125]; ll m, dp[125][240795]; int main(){ cin n m; 阅读全文
posted @ 2018-04-17 08:34 poorpool 阅读(170) 评论(0) 推荐(0)
摘要:"ref" cpp include include include include using namespace std; typedef long long ll; int ua, ub, uc, ud, n, m, a[50005], chu[50005], blc, bel[50005], 阅读全文
posted @ 2018-04-17 07:59 poorpool 阅读(109) 评论(0) 推荐(0)
摘要:"problem" 很妙啊……发现状态转移矩阵每一行都可以由上一行平移得到,每次只算第一行然后平移,$O(n^3)$ 就变成了 $O(n^2)$。 cpp include include using namespace std; int n, k; struct Matrix{ int num[20 阅读全文
posted @ 2018-04-16 16:48 poorpool 阅读(182) 评论(0) 推荐(0)
摘要:枚举右端点,然后看左端点合法情况。 先预处理每个颜色 $i$ 的最大出现位置 $max_i$ 和最小出现位置 $min_i$。对于枚举右端点在一个位置 $i$,凡是 $max_k i$ 的颜色 $k$ 都是不能要的。那么要满足右端点往右都合法,就要找出一个 $j i$ 这样的最大的 $j$。那么左端 阅读全文
posted @ 2018-04-16 14:48 poorpool 阅读(398) 评论(0) 推荐(0)
摘要:状压 dp。参考 "there" cpp include include include include using namespace std; typedef long long ll; int T, h, w, m, n, dp[1055][1055], qx[55], qy[55], dx, 阅读全文
posted @ 2018-04-16 11:11 poorpool 阅读(196) 评论(0) 推荐(0)
摘要:给出的图是一个二分图(显然……吗),一个图的最大团=其补图的最大独立集,因此二分图的最大独立集就是补图的最大团。 欲使补图最大团变大,则要最大独立集变大。二分图最大独立集=点数 最小点覆盖。最小点覆盖=最大匹配。 即搞掉哪些边使得最大匹配变小。即二分图的必经边。 二分图的必经边的判断:流量为 $1$ 阅读全文
posted @ 2018-04-15 20:17 poorpool 阅读(293) 评论(0) 推荐(0)
摘要:"there" cpp include include using namespace std; int n, m, mod, nxt[25], too[25][15]; char ss[25]; struct Matrix{ int num[25][25]; Matrix operator (co 阅读全文
posted @ 2018-04-14 08:40 poorpool 阅读(127) 评论(0) 推荐(0)
摘要:"there" 阅读全文
posted @ 2018-04-13 19:48 poorpool 阅读(247) 评论(0) 推荐(0)
摘要:所有的下标从 $0$ 开始。 考虑枚举 $C$ (第一个加上负的等于第二个加上其绝对值)和第二个手链的偏移量 $p$。答案就是 $$\sum_{i=0}^{n 1}(x_i+C y_{(i+p) \bmod n})^2$$ 复制一遍 $y$ 数组就能去掉取模了,再展开就是 $$\sum_{i=0}^ 阅读全文
posted @ 2018-04-13 16:08 poorpool 阅读(162) 评论(0) 推荐(0)
摘要:鬼畜线段树…… "Orz Capella" cpp include include using namespace std; int n, m, uu, vv, opt; double xx[100005], yy[100005], ss, tt, faq[4]; struct SGT{ doubl 阅读全文
posted @ 2018-04-13 08:45 poorpool 阅读(153) 评论(0) 推荐(0)
摘要:"there" cpp include include using namespace std; int n, m, dfn[100005], idx, hea[100005], cnt, uu, vv, siz[100005], fa[100005][19]; int dep[100005], v 阅读全文
posted @ 2018-04-12 20:17 poorpool 阅读(191) 评论(0) 推荐(0)
摘要:"there" 阅读全文
posted @ 2018-04-12 15:42 poorpool 阅读(233) 评论(0) 推荐(0)
摘要:裸dinic就跑过去了,哪用得着平面图最小割=最短路…… cpp include include include include using namespace std; int n, m, w, ss, tt, hea[1000005], cnt, lev[1000005], cur[100000 阅读全文
posted @ 2018-04-12 09:52 poorpool 阅读(153) 评论(0) 推荐(0)
摘要:狗题卡我精度…… "sol" cpp include include include include include include using namespace std; int n; struct Point{ double x, y; }pt[100005], O; double r; co 阅读全文
posted @ 2018-04-11 21:06 poorpool 阅读(105) 评论(0) 推荐(0)
摘要:lct裸题 cpp include include using namespace std; typedef long long ll; int n, m, uu, vv, val[100005], tagm[100005], taga[100005], sum[100005], siz[10000 阅读全文
posted @ 2018-04-11 15:39 poorpool 阅读(113) 评论(0) 推荐(0)
摘要:lct裸题 阅读全文
posted @ 2018-04-11 15:02 poorpool 阅读(121) 评论(0) 推荐(0)
摘要:参考 "there" 和 "there" "题单" cpp include include using namespace std; int n, m, val[300005], ch[300005][2], sum[300005], fa[300005], uu, vv, opt; int rev 阅读全文
posted @ 2018-04-11 11:23 poorpool 阅读(112) 评论(0) 推荐(0)
摘要:prufer序列及其推论。参考 "there" cpp include include include include using namespace std; typedef long long ll; int n, d[155], cnt[155]; ll ans=1; vector vec[3 阅读全文
posted @ 2018-04-10 16:50 poorpool 阅读(99) 评论(0) 推荐(0)
摘要:"there" cpp include include include include include include using namespace std; int n, m, aa[300005], bb[300005], lim=1, tmpcnt, rev[1100005]; const 阅读全文
posted @ 2018-04-10 11:57 poorpool 阅读(103) 评论(0) 推荐(0)
摘要:"这里" cpp include include include include include using namespace std; typedef long long ll; int T, n, lim, c[100005], rev[270005], tmpcnt, a[100005]; 阅读全文
posted @ 2018-04-10 09:53 poorpool 阅读(76) 评论(0) 推荐(0)
摘要:参考资料 "picks" "miskcoo" "menci" "胡小兔" "unname" "自为风月马前卒" 上面是FFT的,学完了就来看 "NTT" 吧 "原根" 例题:luogu3803 fft优化后模板 cpp include include include using namespace 阅读全文
posted @ 2018-04-09 16:19 poorpool 阅读(256) 评论(0) 推荐(0)
摘要:```cpp include include include using namespace std; typedef long long ll; int n, m, uu, vv, hea[100005], cnt, siz[100005], dfn[100005], loo[100005], i 阅读全文
posted @ 2018-04-09 08:55 poorpool 阅读(130) 评论(0) 推荐(0)
摘要:参考 "这里" cpp include include include using namespace std; typedef long long ll; int n, m, ise[100005], fa[100005][19], dep[100005], uu, vv, ww, hea[100 阅读全文
posted @ 2018-04-08 19:14 poorpool 阅读(251) 评论(0) 推荐(0)
摘要:拆点。 cpp include include include include using namespace std; int n, m, hea[2005], cnt, ss, tt, uu, vv, maxFlow, ans, lev[2005]; const int oo=0x3f3f3f3 阅读全文
posted @ 2018-04-08 15:39 poorpool 阅读(1473) 评论(0) 推荐(0)
摘要:二分图的(不)可行边。 cpp include include include include include using namespace std; int n, m, T, ss, tt, hea[20005], cnt, uu[100005], vv[100005], cur[20005], 阅读全文
posted @ 2018-04-08 11:28 poorpool 阅读(1360) 评论(0) 推荐(0)
摘要:最小路径可重点覆盖。先传递闭包,然后拆点,$n $最大匹配,看算法竞赛进阶指南。 cpp include include include using namespace std; int n, m, uu, vv, mat[205], ans; bool w[205][205], vis[205]; 阅读全文
posted @ 2018-04-08 09:20 poorpool 阅读(204) 评论(0) 推荐(0)
摘要:```cpp include include include include include using namespace std; int n, m, tu, tv, v, xu[55], yu[55], xv[55], yv[55], hea[2705], cnt, cur[2705]; in 阅读全文
posted @ 2018-04-07 21:41 poorpool 阅读(180) 评论(0) 推荐(0)
摘要:day0 动身去太原。太原五中虽然挺小的但是很好看啊qwq(进门口一个“通天堂”(逃 试机。似乎看到了__stdcall!!然而没敢去认orz。linux选手似乎是9个。准考证(一整张A4纸)发下来了。不用建子目录?lemon? 回酒店,吃饭。吃完饭还搞了一份鸡排(每到一个地方,就要吃那个地方的鸡排 阅读全文
posted @ 2018-04-05 22:12 poorpool 阅读(783) 评论(5) 推荐(0)