11 2018 档案
摘要:题目链接:https://www.luogu.org/problemnew/show/P1879 状压DP。 设dp[i][j]表示第i行,状态为j的方案数 初始dp[0][0] = 1 这样一共12行12列,最多1 include include include define ll long lo
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P4180 这个题卡树剖。记得开O2。 这个题inf要到1e18。 定理:次小生成树和最小生成树差距只有在一条边上 非严格次小生成树:枚举每一条不在最小生成树上的边,加入到最小生成树中构成一个环。删去这个环上的最大
阅读全文
摘要:考试题。 是个DP。 50分可以通过子集枚举+线段覆盖(贪心)完成。 考试没时间写了一个子集枚举30分。 include include include include include using namespace std; const int maxn = 1e6 + 10; inline in
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P2831 写点做题总结:dp,搜索,重在设计状态,状态设的好,转移起来也方便。 对于一条抛物线,三点确定。(0,0)是固定的,所以我们一条抛物线要用两只猪确定。再多的猪就只能用来判断是不是在这条抛物线上了。 于是
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P1850 难的不在状态上,难在转移方程。 (话说方程写错居然还有84分= =) include include include include define ll long long using namespac
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P1558 我知道三十棵线段树很暴力,可是我们可以状压啊。 颜色最多30,不会爆int 另外 吐槽评测机 include include include include using namespace std; c
阅读全文

浙公网安备 33010602011771号