由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - [InterviewStreet] Lego Blocks (50 Points)
相关主题
出道小题Ask a google interview question
[InterviewStreet] XOR key (50 Points),请pass的大牛给点思路Palantir新鲜面经
[InterviewStreet] Grid Walking (Score 50 points)求暴力fibonacci的复杂度
贴两个比较tricky,又常被问到的面试题fibonacci 复杂度这么简单推一下对不对?
Fibonacci序列的时间和空间复杂度是多少呀?今天一道面试题主动跪了
一道题Fibonacci数计算 要求constant time
今早google电面报告问个G家面经题
用什么数据结构快速insert, get medianleetcode: largest rectangle in histogram求帮助
相关话题的讨论汇总
话题: blocks话题: total话题: lego话题: points
进入JobHunting版参与讨论
1 (共1页)
v***a
发帖数: 365
1
Define:
C[i]: Total different number of blocks when height_1 weight_i. Including non
-solid structure. Like Fibonacci, number:
C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4]
B[i]: Total different number of blocks when height_N weight_i. Including non
-solid structure. Please use the O(LogN) method to calculate power:
B[i] = power( C[i], N )
A[i]: Total different number of blocks when height_N weight_i. Only SOLID
structure.
A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))
A[M] is the answer.
tips:
1) use (...) % Mod everywhere.
2) use int64 or long long, because you need to use multiple.
很不好意思,突然发现这是个烙印的startup,所以如果他知道你不是印度人的话,有
些……都懂得
但是大家自己可以去公司的网站自己apply,把成绩贴上去
团结,被烙印欺负了,不还手就有些不爽了!
q****x
发帖数: 7404
2
看不懂题目。

non
non

【在 v***a 的大作中提到】
: Define:
: C[i]: Total different number of blocks when height_1 weight_i. Including non
: -solid structure. Like Fibonacci, number:
: C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4]
: B[i]: Total different number of blocks when height_N weight_i. Including non
: -solid structure. Please use the O(LogN) method to calculate power:
: B[i] = power( C[i], N )
: A[i]: Total different number of blocks when height_N weight_i. Only SOLID
: structure.
: A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))

q***p
发帖数: 16
3
谢谢viisa这么认真写报告来帮助找不到思路的朋友~
我第一次用O(N)的球Power也过了。但O(LogN)的二分求法确实快不少。

non
non

【在 v***a 的大作中提到】
: Define:
: C[i]: Total different number of blocks when height_1 weight_i. Including non
: -solid structure. Like Fibonacci, number:
: C[i] = C[i - 1] + C[i - 2] + C[i - 3] + C[i - 4]
: B[i]: Total different number of blocks when height_N weight_i. Including non
: -solid structure. Please use the O(LogN) method to calculate power:
: B[i] = power( C[i], N )
: A[i]: Total different number of blocks when height_N weight_i. Only SOLID
: structure.
: A[i] = B[i] - Sum(A[j] * B[i - j] | for j = 1 to (i - 1, inclusive))

l***i
发帖数: 1309
4
If you look at the leader board, most top 10 are from China.
1 (共1页)
进入JobHunting版参与讨论
相关主题
leetcode: largest rectangle in histogram求帮助Fibonacci序列的时间和空间复杂度是多少呀?
Cloudera面经,onsite + phone一道题
垒墙面试题求帮助今早google电面报告
求问hackerrank的lego blocks题用什么数据结构快速insert, get median
出道小题Ask a google interview question
[InterviewStreet] XOR key (50 Points),请pass的大牛给点思路Palantir新鲜面经
[InterviewStreet] Grid Walking (Score 50 points)求暴力fibonacci的复杂度
贴两个比较tricky,又常被问到的面试题fibonacci 复杂度这么简单推一下对不对?
相关话题的讨论汇总
话题: blocks话题: total话题: lego话题: points