"Description" 思路 这题的思想有点类似求树的重心。 首先思考一下如果只要求一个点的差值。那么显然,将这个点看作根节点,然后只要dfs一下,将与它连接的所有子树中各个最大差值求个和就是答案。 在dfs的过程中把每个结点的求的值记录下来,那么对于每个结点,下面的最大差值都已经求好了,就剩下 ...
分类:
其他好文 时间:
2020-04-29 23:25:21
阅读次数:
52
先出现的是超过最大调用栈问题: npm ERR! Maximum call stack size exceeded 百度之后说给npm降级或者升级 降级 : npm install -g npm@5.4.0 升级 : npm install -g npm 升级到最新版 结果降级之后再尝试的时候就直接 ...
分类:
其他好文 时间:
2020-04-29 20:23:04
阅读次数:
90
1 简介 逻辑斯谛回归(logistic regression)是统计学习中的经典分类方法。 最大嫡是概率模型学习的一个准则,将其推广到分类问题得到最大嫡模型(maximum entropy model )。 逻辑斯谛回归模型与最大嫡模型都属于对数线性模型。 2 模型 2.1 逻辑斯谛分布 2.2 ...
分类:
其他好文 时间:
2020-04-28 17:31:04
阅读次数:
56
Description 找到一个数列(长度不超过 $10^4$),使得有且仅有 $x$ 个非空子数列中元素极差小于 $d$,或者判定不存在。 Solution 考虑如何让后加的子序列中的数不会影响到前面的,只需要加一个 $d$,就可以形成新的一组 于是我们需要将自学列拆成若干个互不相干的组,每组内取 ...
分类:
其他好文 时间:
2020-04-28 15:16:36
阅读次数:
39
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> 其中 width:viewport 的宽度,可以 ...
分类:
移动开发 时间:
2020-04-28 15:16:23
阅读次数:
65
题目英文版: The only difference between the easy and the hard versions is the maximum value of k. You are given an infinite sequence of form "1121231234123 ...
分类:
其他好文 时间:
2020-04-28 12:33:44
阅读次数:
91
In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty. Return the ma ...
分类:
其他好文 时间:
2020-04-28 00:42:36
阅读次数:
52
题目描述 The only difference between the easy and the hard versions is the maximum value of k. You are given an infinite sequence of form "112123123412345 ...
分类:
其他好文 时间:
2020-04-27 22:17:24
阅读次数:
94
最长公共子序列 longest common subsequence,LCS 说明:子序列中的字符与子字符串中的字符不同,它们不需要是连续的,例如: 字符串1:BDCABA;字符串2:ABCBDAB 最长公共子序列长度为4,最长公共子序列是:BCBA 算法求解——动态规划 最优子结构 设两个字符串分 ...
分类:
其他好文 时间:
2020-04-27 22:11:55
阅读次数:
51
Given a matrix of integers A with R rows and C columns, find the maximum score of a path starting at [0,0] and ending at [R-1,C-1]. The score of a pat ...
分类:
其他好文 时间:
2020-04-27 09:21:15
阅读次数:
58