摘要: "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 阅读(165) 评论(0) 推荐(0)
摘要: 定义区间是内部只含有乘号的区间。 对于区间左端点是 $l \geq 2$ 的情况,左端点前头是加号的情况和前头是减号的情况的个数是相同的。因此这些区间不对答案产生贡献。 所以区间左端点必定是 $1$。当 $r=n$ 时,这个区间产生一次贡献。当 $r include include using na 阅读全文
posted @ 2018-04-19 16:57 poorpool 阅读(114) 评论(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 阅读(191) 评论(0) 推荐(0)
摘要: 欲学矩阵树定理~~必先自宫~~学习 "一些行列式的姿势" 然后 "做一道例题" 阅读全文
posted @ 2018-04-19 15:24 poorpool 阅读(110) 评论(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 阅读(299) 评论(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 阅读(266) 评论(0) 推荐(0)