M*I
2 楼
突然想到这个问题,这样搬运工们就可以减少折腾了。
H*5
3 楼
现在很多题目都是有越来越牛X的解法跳出来。
我现在强迫症每题都要翻下discuss 排第一的解法
我现在强迫症每题都要翻下discuss 排第一的解法
l*9
4 楼
克星
z*n
5 楼
看不到题目,但记得POJ有类似什么最大平均的题目,当时看解法也觉着很巧。POJ大神
么出来科普下?
么出来科普下?
M*I
6 楼
似乎是没有漏洞
z*0
7 楼
LeetCode 644. Maximum Average Subarray II
Given an array consisting of n integers, find the contiguous subarray whose
length is greater than or equal to k that has the maximum average value. And
you need to output the maximum average value.
Example:
Input: [1,12,-5,-6,50,3], k = 4
Output: 12.75
Explanation:
when length is 5, maximum average value is 10.8,
when length is 6, maximum average value is 9.16667.
Thus return 12.75.
【在 z*********n 的大作中提到】
: 看不到题目,但记得POJ有类似什么最大平均的题目,当时看解法也觉着很巧。POJ大神
: 么出来科普下?
Given an array consisting of n integers, find the contiguous subarray whose
length is greater than or equal to k that has the maximum average value. And
you need to output the maximum average value.
Example:
Input: [1,12,-5,-6,50,3], k = 4
Output: 12.75
Explanation:
when length is 5, maximum average value is 10.8,
when length is 6, maximum average value is 9.16667.
Thus return 12.75.
【在 z*********n 的大作中提到】
: 看不到题目,但记得POJ有类似什么最大平均的题目,当时看解法也觉着很巧。POJ大神
: 么出来科普下?
z*0
8 楼
O(N) 解法参考section 3
https://arxiv.org/pdf/cs/0311020.pdf
【在 z*********n 的大作中提到】
: 看不到题目,但记得POJ有类似什么最大平均的题目,当时看解法也觉着很巧。POJ大神
: 么出来科普下?
https://arxiv.org/pdf/cs/0311020.pdf
【在 z*********n 的大作中提到】
: 看不到题目,但记得POJ有类似什么最大平均的题目,当时看解法也觉着很巧。POJ大神
: 么出来科普下?
H*5
9 楼
papert太长了看的累。
Leetcode discuss 里的最优解代码就是这个paper的实现吗?
: O(N) 解法参考section 3
: https://arxiv.org/pdf/cs/0311020.pdf
【在 z*******0 的大作中提到】
: O(N) 解法参考section 3
: https://arxiv.org/pdf/cs/0311020.pdf
Leetcode discuss 里的最优解代码就是这个paper的实现吗?
: O(N) 解法参考section 3
: https://arxiv.org/pdf/cs/0311020.pdf
【在 z*******0 的大作中提到】
: O(N) 解法参考section 3
: https://arxiv.org/pdf/cs/0311020.pdf
z*0
10 楼
Yep, the section 3 of the paper.
【在 H**********5 的大作中提到】
: papert太长了看的累。
: Leetcode discuss 里的最优解代码就是这个paper的实现吗?
:
:
: O(N) 解法参考section 3
:
: https://arxiv.org/pdf/cs/0311020.pdf
:
【在 H**********5 的大作中提到】
: papert太长了看的累。
: Leetcode discuss 里的最优解代码就是这个paper的实现吗?
:
:
: O(N) 解法参考section 3
:
: https://arxiv.org/pdf/cs/0311020.pdf
:
j*b
11 楼
假如面试遇到这道题,需要提前理解一篇paper才能知道最优解的,当场没想出来给挂
了,算被黑吗?
了,算被黑吗?
y*u
12 楼
算命苦…
[在 jiayouahb (加油啊洪斌) 的大作中提到:]
:假如面试遇到这道题,需要提前理解一篇paper才能知道最优解的,当场没想出来给挂
:了,算被黑吗?
[在 jiayouahb (加油啊洪斌) 的大作中提到:]
:假如面试遇到这道题,需要提前理解一篇paper才能知道最优解的,当场没想出来给挂
:了,算被黑吗?
相关阅读