2017年1月22日

hdu 6012 Lotus and Horticulture 打标记

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6012 我们希望能够快速算出,对于每一个温度,都能够算出它在这n颗植物中,能得到多少价值。 那么,对于第i科植物,在[0, L[i] - 1]这些温度中,得到的价值是低温那个价值,同理在[L[i], R[i]]中, 阅读全文

posted @ 2017-01-22 23:37 stupid_one 阅读(213) 评论(0) 推荐(0) 编辑

hdu 6011 Lotus and Characters 贪心

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6011 先把数字从小到大排好,比如是-6、3、4这样, 然后处理出后缀和,当后缀和 <= 0的时候马上停止就好了。 证明: 假如现在是去到了第二个,也就是那个3,后缀和是7,那么我选不选-6呢? 如果选, 结果是: 阅读全文

posted @ 2017-01-22 01:15 stupid_one 阅读(219) 评论(0) 推荐(0) 编辑

leetcode 484. Find Permutation 思维题

摘要: https://leetcode.com/contest/leetcode-weekly-contest-16a/problems/find-permutation/ 设原本的数字是0,那么按照它的DI来模拟,D就减1,I就+1 比如DDIIDI,就是0、-1、-2、-1、0、-1、0 那么找到第一 阅读全文

posted @ 2017-01-22 01:10 stupid_one 阅读(373) 评论(0) 推荐(0) 编辑

导航