题目描述: 样例: 数据范围与约定: 标签:平衡树,DP 考虑DP:令$dp(i,j)$表示前$i$个点选$j$个,能得到的最大价值。 得到转移方程:$dp(i,j)=\max\{dp(i 1,j),dp(i 1,j 1)+a_i\cdot j\}$ 这个方程很明显是$n^2$的。 经过打表/分析样 ...
分类:
其他好文 时间:
2019-01-12 23:00:26
阅读次数:
371
报错的原因是路由不能写外部链接 写成<a href=""></a> ...
分类:
其他好文 时间:
2019-01-11 18:07:32
阅读次数:
596
似然与概率 https://blog.csdn.net/u014182497/article/details/82252456 在统计学中,似然函数(likelihood function,通常简写为likelihood,似然)是一个非常重要的内容,在非正式场合似然和概率(Probability)几 ...
分类:
其他好文 时间:
2019-01-10 21:48:55
阅读次数:
172
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both sand t. t is pot ...
分类:
其他好文 时间:
2019-01-09 18:49:23
阅读次数:
188
这道题比较简单,虽然不知道为什么被贴上了困难的标签~ 贴上题目: 中文翻译: 现在有一个无序数组,找出数组在排序后,相邻元素差值的最大值 如果元素个数少于两个,就返回0. emmmmm~ 思路很暴力:排序,求差值。 上代码: ...
分类:
其他好文 时间:
2019-01-06 22:29:01
阅读次数:
217
The maximum subarray problem is one of the nicest examples of dynamic programming application. In this lesson we cover an example of how this problem ...
分类:
编程语言 时间:
2019-01-06 10:37:13
阅读次数:
180
Android中Activity是作为应用程序的载体存在,代表着一个完整的用户界面,提供了一个窗口来绘制各种视图,当Activity启动时,我们会通过setContentView方法来设置一个内容视图,这个内容视图就是用户看到的界面。 PhoneWindow是Android系统中最基本的窗口系统,每 ...
分类:
移动开发 时间:
2019-01-05 19:59:04
阅读次数:
221
1 2 3 4 5 6 7 管理后台 8 9 10 11 12 13 14 15 16 + 17 + 18 + 19 20 {{ fullname }} 21 {{ fullname }} 22 {{ fullname... ...
分类:
其他好文 时间:
2019-01-04 22:01:07
阅读次数:
224
处理快速排序,递归深度可能非常大,而系统默认的深度可能没有这么大 需要设置最大递归深度 ...
分类:
编程语言 时间:
2019-01-04 10:37:11
阅读次数:
218
然后看了一下讨论 思路大概就是建立一个dp矩阵,然后将每一个数,到它自身这个位置时的最大值保存起来。这样就只用遍历一次,时间复杂度为O(n) ...
分类:
其他好文 时间:
2019-01-03 13:59:51
阅读次数:
149