摘要: 标签: 线段树 题目链接 https://codeforces.com/contest/981/problem/E 分析 在线段树的每个节点维护一个 . 代码 cpp include include include include include include include using name 阅读全文
posted @ 2018-06-08 17:51 sciorz 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 牛客练习赛19 托米去购物 标签: 网络流 题目链接 https://www.nowcoder.com/acm/contest/111/D 分析 + 因为总金额有限,所以要求现金使用最小也就意味着优惠券使用最多 + 源点连优惠券,流量为优惠券金额;优惠券连物品,流量为INF;物品连汇点,流量为物品价 阅读全文
posted @ 2018-06-08 14:04 sciorz 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 标签 : 状态压缩dp 题目链接 https://www.nowcoder.com/acm/contest/111/B 分析 + 用dp[i][j]来表示已经有i个人成功就坐,且坐下的状态为j的二进制. + 转移的时候枚举第i个人卡片上的数字 代码 cpp include include inclu 阅读全文
posted @ 2018-06-08 13:50 sciorz 阅读(140) 评论(0) 推荐(0) 编辑