博客园 首页 私信博主 显示目录 隐藏目录 管理 动画
摘要: 题面 给你一个二叉树。 每个叶节点的贡献为:ci*(左边标记次数+ai)*(右边标记次数+bi)。 使该贡献最小。 考虑树形dp(记搜)。 IDEA: (题解区大佬的压空间有点看不太懂。于是蒟蒻就选择了这种方法……代码也很短x.) #include <bits/stdc++.h> #define l 阅读全文
posted @ 2019-03-18 16:52 楚泫 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 思路比较有趣,也比较新颖。 但想通了其实ok。 IDEA: #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <queue> #define 阅读全文
posted @ 2019-03-18 15:51 楚泫 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 网络流24题练习。 一开始看到题目,觉得挺简单。 然后在如何处理 " 一天用完的脏毛巾洗完后转移到后面的天数 " 时卡住了。 思路是这样的: 建完图dinic走一波。注意开long long。 #include <iostream> #include <cstdio> #include <cmath 阅读全文
posted @ 2019-03-18 11:00 楚泫 阅读(140) 评论(0) 推荐(0) 编辑