摘要: 二分答案限制最大的多少,然后再DP一下 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> const int Dollar1 = 10007; const int MAXN = 50010; i 阅读全文
posted @ 2019-02-11 13:16 daklqw 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 一开始写状压的的我菜爆了……然后调不过。 后来发现~~(直接搜索)~~直接最短路就行了…… $f[i]$表示前$i$天最少需要多少 \(f[i] = min(f[j] + dis(j + 1, i))\) 然后就好了 #include <iostream> #include <cstdio> #in 阅读全文
posted @ 2019-02-11 13:12 daklqw 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 直线代入一点值相当于向量 (k,a) 和 (x, 1) 的点积,于是根据点积最大化思想直接跑上凸壳就对了。 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> const int MAXN = 5 阅读全文
posted @ 2019-02-11 13:10 daklqw 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 根据prufer序列可以一一对应无根树。 一个度数为$n$的会出现$n - 1$次,然后组合数算一算就好了。 注意高精度 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> int n, t; c 阅读全文
posted @ 2019-02-11 13:08 daklqw 阅读(179) 评论(0) 推荐(0) 编辑