Redian新闻
>
开户的Required Minimums 10000$?
avatar
开户的Required Minimums 10000$?# Stock
y*3
1
别人问我的,我不会做,大家贡献点idea:
有一个二维数组String[][],就像excel那样的表格,横行都用1,2,3...表示,纵行用A
,B,C...表示,每个格子里是一个数学表达式,比如下边这个:
A B C
1: 7-4 C3*2 4
2: 10/2 A1+C2 0
3: C3 10-7 4/2
写一个method,要求返回一个String[][],每个格子中是相应格子里的表达式的结果。
难点在于:如果格子互相之间有循环refer,则返回空值。比如下边这个就是循环
reference:
A B C
1: 13-5 C3 B3
2: 12-7 C1 0
3: 11*24 A1+B2 42
avatar
y*e
2
新手想在Interactive Brokers开个户,怎么发现这么高的 minimum?我搞错了?
avatar
y*3
3
我能想到的就是类似求图中的回路的做法,但是好像不是最佳解。
avatar
n*n
4
没有一万炒什么股?都给券商打工了。

【在 y*****e 的大作中提到】
: 新手想在Interactive Brokers开个户,怎么发现这么高的 minimum?我搞错了?
avatar
d*e
5
拓扑排序?

用A

【在 y*****3 的大作中提到】
: 别人问我的,我不会做,大家贡献点idea:
: 有一个二维数组String[][],就像excel那样的表格,横行都用1,2,3...表示,纵行用A
: ,B,C...表示,每个格子里是一个数学表达式,比如下边这个:
: A B C
: 1: 7-4 C3*2 4
: 2: 10/2 A1+C2 0
: 3: C3 10-7 4/2
: 写一个method,要求返回一个String[][],每个格子中是相应格子里的表达式的结果。
: 难点在于:如果格子互相之间有循环refer,则返回空值。比如下边这个就是循环
: reference:

avatar
y*e
6
大虾们说 新手少放点钱比较好嘛,所以放几千练习练习嘛。
确实要10000?考!
avatar
S*e
7
对每个cell感觉dfs就可以了,如果碰到死循环就把沿路都设为空值
avatar
n*n
8
纸交吧。几千块钱学不到东西。

【在 y*****e 的大作中提到】
: 大虾们说 新手少放点钱比较好嘛,所以放几千练习练习嘛。
: 确实要10000?考!

avatar
x*g
9
分两部分。
A:已经算好的。(开始是所有的裸表达的.)
B:有ref的。(开始是所有有ref的.)
找B里仅由A中构成的,记为C. 计算出来。
完了重复找和C相关的,仅有A+C (C并入A)构成的作为下一个C.
重复直到找不到则结束。B中剩下的全部有问题。

用A

【在 y*****3 的大作中提到】
: 别人问我的,我不会做,大家贡献点idea:
: 有一个二维数组String[][],就像excel那样的表格,横行都用1,2,3...表示,纵行用A
: ,B,C...表示,每个格子里是一个数学表达式,比如下边这个:
: A B C
: 1: 7-4 C3*2 4
: 2: 10/2 A1+C2 0
: 3: C3 10-7 4/2
: 写一个method,要求返回一个String[][],每个格子中是相应格子里的表达式的结果。
: 难点在于:如果格子互相之间有循环refer,则返回空值。比如下边这个就是循环
: reference:

avatar
h*8
10
开了不用,再转出去。

【在 y*****e 的大作中提到】
: 新手想在Interactive Brokers开个户,怎么发现这么高的 minimum?我搞错了?
avatar
y*3
11
谢谢大牛!这大概是最好的解法了。我还是太笨了,想了一晚上没想出来。。

【在 x****g 的大作中提到】
: 分两部分。
: A:已经算好的。(开始是所有的裸表达的.)
: B:有ref的。(开始是所有有ref的.)
: 找B里仅由A中构成的,记为C. 计算出来。
: 完了重复找和C相关的,仅有A+C (C并入A)构成的作为下一个C.
: 重复直到找不到则结束。B中剩下的全部有问题。
:
: 用A

avatar
l*6
12
The problem can be abstract to one dimension by ignore parse issue.
it can be solved with dp :
pick each cell , do:
1. if it is previous recorded then return result(a number result
or a bad cell result)
2. else if it is marked as 'don't touch' record it as bad cell
return a bad cell result (circle detected)
3. else if it contains only number calculate it, record it and
return result
4. else mark it as 'don't touch' in the record area , then
recursive calculate related cells involved in this cell calculation. If all
returns normal result, combine them get the result. If any return a bad cell
result , it is a bad cell. Replace the 'don't touch' sign with the result
and return the result.
avatar
A*c
13
嗯,合理。不用想得太复杂,这个算法和就是把人的做法code出来。

【在 x****g 的大作中提到】
: 分两部分。
: A:已经算好的。(开始是所有的裸表达的.)
: B:有ref的。(开始是所有有ref的.)
: 找B里仅由A中构成的,记为C. 计算出来。
: 完了重复找和C相关的,仅有A+C (C并入A)构成的作为下一个C.
: 重复直到找不到则结束。B中剩下的全部有问题。
:
: 用A

avatar
l*6
14
This would rely on the order..
e.g cell with a to z
a[b + c + ..z] , b[c + d +.. z] , c[d + .. z] , .... w[y + z] y[z] z[1]
scan left to right , each time only one cell can be solved.

【在 A*********c 的大作中提到】
: 嗯,合理。不用想得太复杂,这个算法和就是把人的做法code出来。
avatar
x*g
15
这貌似没办法,依赖决定了。
你怎么弄也得一个个算。
难道你不算w就可以算w之前的?
唯一的影响是,你受到从前往后扫描思路的限制,
所以从前往后成了你这次扫描的死穴,呵呵。
所以你的问题已经转变成怎么表达这种依赖关系从而避免低性能扫描。
而你选择了递归。
:)

【在 l******6 的大作中提到】
: This would rely on the order..
: e.g cell with a to z
: a[b + c + ..z] , b[c + d +.. z] , c[d + .. z] , .... w[y + z] y[z] z[1]
: scan left to right , each time only one cell can be solved.

avatar
l*6
16
I choose dp...

【在 x****g 的大作中提到】
: 这貌似没办法,依赖决定了。
: 你怎么弄也得一个个算。
: 难道你不算w就可以算w之前的?
: 唯一的影响是,你受到从前往后扫描思路的限制,
: 所以从前往后成了你这次扫描的死穴,呵呵。
: 所以你的问题已经转变成怎么表达这种依赖关系从而避免低性能扫描。
: 而你选择了递归。
: :)

avatar
x*g
17
请教一下啥是你所谓的dp? 没看懂你的dp。
指教一下也好,呵呵!

【在 l******6 的大作中提到】
: I choose dp...
avatar
l*6
18
Build the result container same shape as input.
Initialize all the result container as untouched.
Then work with recursion.
All the result computed along recursion will be recorded in result container
to avoid repeat computation.
For this problem the extra part is the 'don't touch' sign. If a cell is
involved during the recursion start from it, it is a circle. When it happens
, it is a bad cell. And any cell has relation to bad cell are bad cell.

【在 x****g 的大作中提到】
: 请教一下啥是你所谓的dp? 没看懂你的dp。
: 指教一下也好,呵呵!

avatar
x*g
19
没错,你可以怎么做,没问题。
1:啥是dp?
2: 不这么做为什么会有repeat computation.
算了,瞎琢磨吧,呵呵。

container
happens

【在 l******6 的大作中提到】
: Build the result container same shape as input.
: Initialize all the result container as untouched.
: Then work with recursion.
: All the result computed along recursion will be recorded in result container
: to avoid repeat computation.
: For this problem the extra part is the 'don't touch' sign. If a cell is
: involved during the recursion start from it, it is a circle. When it happens
: , it is a bad cell. And any cell has relation to bad cell are bad cell.

avatar
l*6
20
dp dynamic programming
Your algorithm contains repeat:
each scan when check every cell int A whether contains element only in C.
Repeat scan also happens.
I think in one of my previous interview I proposed similar algorithm to a
different problem and interviewer asked me the complexity. When I say worst
is n^2 , I 羞涩地 know he won't let me pass.

【在 x****g 的大作中提到】
: 没错,你可以怎么做,没问题。
: 1:啥是dp?
: 2: 不这么做为什么会有repeat computation.
: 算了,瞎琢磨吧,呵呵。
:
: container
: happens

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。