2017年2月3日

1272 最大距离 只想到了dp

摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1272 离散化后,用dp[i]表示向右,大于等于i这个数字的最大位置 dp[i] = max(dp[i + 1], dp[i]) #include <cstdio> #inc 阅读全文

posted @ 2017-02-03 03:33 stupid_one 阅读(152) 评论(0) 推荐(0) 编辑

1270 数组的最大代价 dp

摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1270&judgeId=194704 一开始贪心,以为就两种情况,大、小、大、小.....这样下去 小、大、小、大、....这样下去, 结果翻车。比如1、2、1、1、2、1这 阅读全文

posted @ 2017-02-03 02:39 stupid_one 阅读(146) 评论(0) 推荐(0) 编辑

1246 罐子和硬币 模拟题,感觉只能模拟

摘要: http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1246 这题平均分不是最优的,需要有一些空位置。 比如3 10 10 答案应该是11,分配就是,第一个是0,其他的均分。 所以我需要知道应该空出多少个位置,使得答案更优。 我 阅读全文

posted @ 2017-02-03 01:02 stupid_one 阅读(168) 评论(0) 推荐(0) 编辑

导航