Loading

摘要: 1.CF189A https://www.luogu.com.cn/problem/CF189A 注意初始化问题,背包必须装满才合法,一个解只能由合法的解转移而来,于是: \(f[0] = 0, f[n] = -1\) 阅读全文
posted @ 2021-01-18 21:32 aldol_reaction 阅读(39) 评论(0) 推荐(0)
摘要: ###存图 struct edge { int u, v, w; edge(int _u = 0, int _v = 0, int _w = 0) { u = _u, v = _v, w = _w; } friend bool operator < (edge a, edge b) { return 阅读全文
posted @ 2021-01-31 23:07 aldol_reaction 阅读(49) 评论(0) 推荐(0)
摘要: 数学分析: 时间复杂度:\(O(logn)\) 空间复杂度:\(O(n)\) 层数:\(O(logn)\) ####单点修改,区间查询详解 用于可以差分的查询(前缀和->容斥) 查询像最大值这样无法差分的东西,只能1到x查询 lowbit: $1$最后的位置,通过 \(x\&(-x)\) 获得 计算 阅读全文
posted @ 2021-01-30 15:22 aldol_reaction 阅读(52) 评论(0) 推荐(0)