随笔分类 -  线段树

摘要:题目:戳这里 学习博客:戳这里 题意:有很多个活动,每个活动有持续天数,每个活动会在每天提供C个CPU每个CPU价格为P,问需要工作N天,每天需要K个CPU的最少花费。 解题思路:遍历每一天,维护当前天K个cpu的最小花费。具体方法是维护两个线段树(树状数组也可以),维护每一天可以使用的cpu数和价 阅读全文
posted @ 2018-10-31 22:18 euzmin 阅读(203) 评论(0) 推荐(0)
摘要:hdu - 1166 敌兵布阵(求和) 题目链接:戳这里 1 #include <cstdio> 2 #include <cstring> 3 #include <string> 4 #include <algorithm> 5 #include <cmath> 6 #include <vector 阅读全文
posted @ 2018-08-05 21:13 euzmin 阅读(142) 评论(0) 推荐(0)
摘要:E. Exposition time limit per test 1.5 seconds memory limit per test 64 megabytes input standard input output standard output E. Exposition time limit 阅读全文
posted @ 2017-11-12 15:35 euzmin 阅读(288) 评论(0) 推荐(0)