摘要: 线性DP预处理+分组背包 首先设 表示该木板前 个格刷了 次且最后一次颜色为 的最大正确数 做下 的前缀和然后转移状态 然后对每个木板跑分组背包就可以了 cpp include"cstdio" include"cstring" include"iostream" include"algorithm" 阅读全文
posted @ 2018-12-04 18:36 A·H 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 考虑 运算的自反性 我们可以直接枚举二进制位异或来进行转移 这样边数大约是$n \log n$级别的 总复杂度$\Theta((n\log n+m)\log n)$ cpp include"cstdio" include"cstring" include"iostream" include"algo 阅读全文
posted @ 2018-12-04 15:03 A·H 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 状压DP $dp[i]$表示当前选人状态为$i$且选择了前$i.count()$个物品时最大的概率 cpp include"cstdio" include"cstring" include"iostream" include"algorithm" using namespace std; const 阅读全文
posted @ 2018-12-04 13:34 A·H 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 裸的二维数点 cpp include"cstdio" include"cstring" include"iostream" include"algorithm" using namespace std; const int MAXN=5e5+5; int n,m,maxn; int Tib[MAXN 阅读全文
posted @ 2018-12-04 12:49 A·H 阅读(148) 评论(0) 推荐(0) 编辑