由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - 想到一个曾经被JPM问过的算法题
相关主题
comp 是什么意思?请辞quant版版主
A C++ question[合集] 关于曾mm的回答
讨论几个 ihtw 大牛的题目[合集] 跪求:Susquehanna International Group on-site 面经。
[合集] 到底什么是bootstrap? (转载)[合集] 大家听说过 Interactive Brokers吗?
JPMorgan Quantitative Research Group C++ Test[合集] Wiki上关于long的解释有误e: holder of an option是 long
one statistic interview question[合集] 有在tudor,winton,caxton的么?
[合集] So far gotten 4 amaranth resumes一道概率题
[合集] 假如自己觉得面世还没准备好的话...ITG 这家公司怎样?
相关话题的讨论汇总
话题: variables话题: testing话题: etc话题: complexity话题: give
进入Quant版参与讨论
1 (共1页)
i****m
发帖数: 15
1
不知道以前被讨论过没有?
好像是
Give four integer variables, a,b,c,d, all are in [1,1000]
and
a^3 + b^3 = c^3 + d^3,
写一个program找出所有的{a,b,c,d}满足上面的方程, what's the complexity, etc.
Obviously testing testing 3 variables and find out the last one, having O(n
^3) is a not the best way to do it.
I***e
发帖数: 1136
2
You need to compute all combination of i^3 + j^3 and keep the results sorted
in the process. Once it's done you simply traverse the list and find all
duplicate sums. The complexity is O(n^2). Memory usage is O(n^2) too. Could
there be O(n log(n)) solutions?
-iCare-

etc.
(n

【在 i****m 的大作中提到】
: 不知道以前被讨论过没有?
: 好像是
: Give four integer variables, a,b,c,d, all are in [1,1000]
: and
: a^3 + b^3 = c^3 + d^3,
: 写一个program找出所有的{a,b,c,d}满足上面的方程, what's the complexity, etc.
: Obviously testing testing 3 variables and find out the last one, having O(n
: ^3) is a not the best way to do it.

n******t
发帖数: 4406
3
Just first calculate all the cubics of the numbers in [1,1000]
then solve x + y = z + w among those numbers.

etc.
(n

【在 i****m 的大作中提到】
: 不知道以前被讨论过没有?
: 好像是
: Give four integer variables, a,b,c,d, all are in [1,1000]
: and
: a^3 + b^3 = c^3 + d^3,
: 写一个program找出所有的{a,b,c,d}满足上面的方程, what's the complexity, etc.
: Obviously testing testing 3 variables and find out the last one, having O(n
: ^3) is a not the best way to do it.

j****e
发帖数: 140
4
are they still hiring?
1 (共1页)
进入Quant版参与讨论
相关主题
ITG 这家公司怎样?JPMorgan Quantitative Research Group C++ Test
[合集] 一道概率题one statistic interview question
警告iq200[合集] So far gotten 4 amaranth resumes
信贷危机后投资银行裁员忙(ZT)[合集] 假如自己觉得面世还没准备好的话...
comp 是什么意思?请辞quant版版主
A C++ question[合集] 关于曾mm的回答
讨论几个 ihtw 大牛的题目[合集] 跪求:Susquehanna International Group on-site 面经。
[合集] 到底什么是bootstrap? (转载)[合集] 大家听说过 Interactive Brokers吗?
相关话题的讨论汇总
话题: variables话题: testing话题: etc话题: complexity话题: give