上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 36 下一页
摘要: 参考资料 1. "PoPoQQQ的PPT" 2. "莫比乌斯反演定理证明" 3. "莫比乌斯反演简要笔记" 定义 $$f(n)=\sum_{d|n}g(d) \Rightarrow g(n)=\sum_{d|n} \mu(d)f(\frac{n}{d}).$$ 更常用的:$$f(n)=\sum_{n 阅读全文
posted @ 2018-01-25 10:10 poorpool 阅读(241) 评论(0) 推荐(0)
摘要: 对每一个宗教建一棵线段树,然后树剖搞搞 cpp include include using namespace std; int n, m, w[100005], c[100005], uu, vv, hea[100005], cnt, dep[100005]; int fa[100005], to 阅读全文
posted @ 2018-01-24 21:01 poorpool 阅读(162) 评论(0) 推荐(0)
摘要: 树状数组不用动脑子真爽啊 cpp include include include using namespace std; typedef long long ll; int m, n, b[100005], rem, rot[100005], lson[20000005], rson[200000 阅读全文
posted @ 2018-01-24 19:38 poorpool 阅读(123) 评论(0) 推荐(0)
摘要: 前置技能:Count on a tree 然后带上一个启发式合并 cpp include include include using namespace std; int n, m, orz, uu, vv, ww, a[80005], b[80005], rnk[80005], rem, cnt, 阅读全文
posted @ 2018-01-24 16:02 poorpool 阅读(176) 评论(0) 推荐(0)
摘要: 二合一…… 阅读全文
posted @ 2018-01-24 10:51 poorpool 阅读(140) 评论(0) 推荐(0)
摘要: 前置技能 :HDU3376 Matrix Again 所以看到这个题,我们也会想着用最大费用最大流解决,因为从起点飞到终点再飞回来,就等于从起点飞两次到终点且这两次飞行除了起点终点之外没有访问超过一次的点。 考虑拆点限流,除起点终点以外的点容量是1(花费代表边权),起点终点容量是2。 输出方案的话, 阅读全文
posted @ 2018-01-24 08:10 poorpool 阅读(120) 评论(0) 推荐(0)
摘要: 最大费用最大流 咋写?取个相反数就可以了…… 阅读全文
posted @ 2018-01-23 21:07 poorpool 阅读(99) 评论(0) 推荐(0)
摘要: 设dp[i][j][k]表示前i个数中选j个并且因子含有k个2的能获得的最多的5的个数 则dp[i][j][k]=max(dp[i 1][j][k],dp[i 1][j 1][k cnt2]+cnt5) 滚掉一维 cpp include include include using namespace 阅读全文
posted @ 2018-01-23 18:41 poorpool 阅读(181) 评论(0) 推荐(0)
摘要: 先算出一个点前头比它大和后头比它小的数量。 每次删点就扔进一个主席树里头,防止造成重复删答案。 cpp include include include using namespace std; int n, m, a[100005], p[100005], c[100005], uu, pre[10 阅读全文
posted @ 2018-01-23 15:35 poorpool 阅读(108) 评论(0) 推荐(0)
摘要: 主席树放到树上而已 cpp include include include using namespace std; int n, m, lstans, uu, vv, a[100005], b[100005], rnk[100005], rem, cnt; int lson[2200005], r 阅读全文
posted @ 2018-01-23 10:03 poorpool 阅读(142) 评论(0) 推荐(0)
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 36 下一页