摘要: 题目链接: 思路就是二分最大值然后用O1背包判断就好了 代码如下: Cpp include using namespace std; int s[1007], v[1007]; int dp[1000007]; int n, m, k; bool judge(int x) { memset(dp, 阅读全文
posted @ 2017-05-31 16:17 aiterator 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目链接: 这道题两种思路 + 1.二分答案加O(n)判断 + 2.直接O(n)尺取法,尺取出最大答案 二分代码: C++ include using namespace std; int arr[1000007]; int n, k; bool judge(int x) { int res = 0 阅读全文
posted @ 2017-05-31 16:12 aiterator 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 题目链接: 这道题的思路就是他总共只有k+1个状态,然后枚举所有状态,满足所有灯亮的条件就更新答案。 代码如下: 阅读全文
posted @ 2017-05-31 15:30 aiterator 阅读(177) 评论(0) 推荐(0) 编辑