Redian新闻
>
急问:continental还是delta, 还是卖了点数?
avatar
急问:continental还是delta, 还是卖了点数?# Money - 海外理财
B*p
1
1st edition section 7.7 no. 6, 2nd edition, section 7.7, no. 12
After the array x[0,,N-1] is initialized to zero. N of the following
operations are performed
for i = L to U do
x[i] += V;
where L, U and V are parameters of each operation (L and U are integers
satisfying 0<=L<=Ureal). After the N operations, the values of x[0] through x[N-1] are
reported in order. The method just
sketched requires O(N^2) time. Can you find a faster algorithm?
1. What is the value of L and U for e
avatar
l*t
2
查了账户,发现自己也得了40k miles,真高兴啊。。。可是我这儿continental的航线
很少,有也很贵或是要几个stops,倒是delta还行。。。看班上的讨论都不建议转
delta,真是纠结。。。
另外由于娃还小,近年旅行不会太多,最多回一下国,也得1年半以后吧,我这种情况
是不是应该把点数去二手卖了?
avatar
Z*Z
3

be
different
I think L and U are fixed for N operations.
The values of X[1] through X[N] is reported in order does not mean X is
sorted.

【在 B*****p 的大作中提到】
: 1st edition section 7.7 no. 6, 2nd edition, section 7.7, no. 12
: After the array x[0,,N-1] is initialized to zero. N of the following
: operations are performed
: for i = L to U do
: x[i] += V;
: where L, U and V are parameters of each operation (L and U are integers
: satisfying 0<=L<=U: real). After the N operations, the values of x[0] through x[N-1] are
: reported in order. The method just
: sketched requires O(N^2) time. Can you find a faster algorithm?

avatar
d*g
4
卖了...
avatar
K*g
5
If L and U are fixed, then the question should be very easy. The complexity
will be O(N). Then what is the point of this problem?

【在 Z*****Z 的大作中提到】
:
: be
: different
: I think L and U are fixed for N operations.
: The values of X[1] through X[N] is reported in order does not mean X is
: sorted.

avatar
l*t
6
谢谢!

【在 d******g 的大作中提到】
: 卖了...
avatar
b*h
7
After the N operations, the values of x[0] through x[N-1] are
The above words doesn't mean x[] is sorted. It just says after those N
operations, you are going to report the values in order. It doesn't matter
how are you going to do it. And it has nothing to do with the previously
described process.
The intent of this problem is asking you to give an algorithm that simulates
the described process in complexity less than O(N^2).
avatar
g*n
8
你那里delta还行就转delta呗,又不过期,现在转还有bonus
avatar
z*o
9
我觉得 L, U 在不同时候是不同的,否则
否则 s = sum(V) 然后 for i = L to V do x[i] = v * N 就可以了
既然说 L, U, V are parameters of each operation, 我觉得他们就是每次可以不同
,否则为啥叫 parameters.
这个应该有 NlogN 的算法
把 L,U 看作一个线段,对所有的线段端点(2N个)排序,
s=0
从左到有扫描端点
如果遇到一个左端点,s+=线段对应的v
如果遇到一个右端点,s-=线段对应的v
处理完一个端点后,s就是x[这个端点+1]到x[下一个端点]的值

【在 B*****p 的大作中提到】
: 1st edition section 7.7 no. 6, 2nd edition, section 7.7, no. 12
: After the array x[0,,N-1] is initialized to zero. N of the following
: operations are performed
: for i = L to U do
: x[i] += V;
: where L, U and V are parameters of each operation (L and U are integers
: satisfying 0<=L<=U: real). After the N operations, the values of x[0] through x[N-1] are
: reported in order. The method just
: sketched requires O(N^2) time. Can you find a faster algorithm?

avatar
L*Y
10
我也是。亚特兰大附近的就转delta了。也不过期。
avatar
n*t
11
芝加哥的话,转CO还是delta?

【在 L**Y 的大作中提到】
: 我也是。亚特兰大附近的就转delta了。也不过期。
avatar
c*x
12

CO

【在 n****t 的大作中提到】
: 芝加哥的话,转CO还是delta?
avatar
m*s
13
boston附近呢?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。