Redian新闻
>
关于无薪假的问题
avatar
关于无薪假的问题# EB23 - 劳工卡
e*s
1
Two reverse sorted arrays A and B have been given, such that size of A is m
and size of B is n
You need to find the k th largest sum (a+b) where a is taken from A and b is
taken from B.
看了好多论坛上的答案,好像都不是很清楚。 有一个用max-heap做的,就是每次从
heap里pop出一个
pair(a[i]+b[j]),然后将 pair(a[i],b[j+1]) 和pair(a[i+1],b[j]) insert到heap里。
但好像需要check是不是重复的pair(a[i],b[j])已经在heap里了。 不知道有没有人有
更清楚的解
法,多谢。
avatar
t*t
2
听说H1B是不能take 无薪假的,现在的身份是485pending,pd是2010 3月,还早着呢。
拿到了ead,但没用过。 现在公司要强制休假,我的假用光了。该怎么办?
avatar
g*i
3
据我所知,用max-heap做的办法(klgn) 是最efficient 办法了。为避免重复,必须用
个变量J-Max track 目前max-heap中所有pair的最大的j. 如果j < J_Max, insert
pair(a[i+1],b[j])到heap里; 如果j = J_Max, 将 pair(a[i],b[j+1]) 和pair(a[i+1
],b[j]) insert到heap里, update as J_Max = J_Max+1.

m
is
里。

【在 e******s 的大作中提到】
: Two reverse sorted arrays A and B have been given, such that size of A is m
: and size of B is n
: You need to find the k th largest sum (a+b) where a is taken from A and b is
: taken from B.
: 看了好多论坛上的答案,好像都不是很清楚。 有一个用max-heap做的,就是每次从
: heap里pop出一个
: pair(a[i]+b[j]),然后将 pair(a[i],b[j+1]) 和pair(a[i+1],b[j]) insert到heap里。
: 但好像需要check是不是重复的pair(a[i],b[j])已经在heap里了。 不知道有没有人有
: 更清楚的解
: 法,多谢。

avatar
f*u
4
谁说的?我认识的不少都用过无薪假的,没见有事啊。
我说的是现实,如果有规定的请指正。
avatar
r*y
5
感觉要看k的大小阿,
比如 a1>a2>a3>..., b1>b2>b3>...
那么 kth largest 应该出现在 这 k个 序列里面.
a_i +b_1, a_i + b_2, ..., a_i + b_k
i= 1, 2, ..., k
然后对这 k个序列做 merge sort, 当拿到 第k个数的时候就是 kth largest.
如果k 比较小的话,这个算法还行吧。

m
is
里。

【在 e******s 的大作中提到】
: Two reverse sorted arrays A and B have been given, such that size of A is m
: and size of B is n
: You need to find the k th largest sum (a+b) where a is taken from A and b is
: taken from B.
: 看了好多论坛上的答案,好像都不是很清楚。 有一个用max-heap做的,就是每次从
: heap里pop出一个
: pair(a[i]+b[j]),然后将 pair(a[i],b[j+1]) 和pair(a[i+1],b[j]) insert到heap里。
: 但好像需要check是不是重复的pair(a[i],b[j])已经在heap里了。 不知道有没有人有
: 更清楚的解
: 法,多谢。

avatar
c*o
6
好像可以预支一些假期吧。

【在 t*********t 的大作中提到】
: 听说H1B是不能take 无薪假的,现在的身份是485pending,pd是2010 3月,还早着呢。
: 拿到了ead,但没用过。 现在公司要强制休假,我的假用光了。该怎么办?

avatar
g*e
7
using young tabelau is clearer.
这个特殊的young tableau求前k个最小值以前讨论过,一直没有更好的算法,没有利用
到这个特殊young tableau的属性
求O(n)算法

m
is
里。

【在 e******s 的大作中提到】
: Two reverse sorted arrays A and B have been given, such that size of A is m
: and size of B is n
: You need to find the k th largest sum (a+b) where a is taken from A and b is
: taken from B.
: 看了好多论坛上的答案,好像都不是很清楚。 有一个用max-heap做的,就是每次从
: heap里pop出一个
: pair(a[i]+b[j]),然后将 pair(a[i],b[j+1]) 和pair(a[i+1],b[j]) insert到heap里。
: 但好像需要check是不是重复的pair(a[i],b[j])已经在heap里了。 不知道有没有人有
: 更清楚的解
: 法,多谢。

avatar
H*G
8
没事呀, 我也这么休过
---
关于无薪假的问题
发信站: BBS 未名空间站 (Thu Jan 24 11:42:34 2013, 美东)
听说H1B是不能take 无薪假的,现在的身份是485pending,pd是2010 3月,还早着呢。
拿到了ead,但没用过。 现在公司要强制休假,我的假用光了。该怎么办?
avatar
e*s
9

+1
非常感谢!

【在 g*****i 的大作中提到】
: 据我所知,用max-heap做的办法(klgn) 是最efficient 办法了。为避免重复,必须用
: 个变量J-Max track 目前max-heap中所有pair的最大的j. 如果j < J_Max, insert
: pair(a[i+1],b[j])到heap里; 如果j = J_Max, 将 pair(a[i],b[j+1]) 和pair(a[i+1
: ],b[j]) insert到heap里, update as J_Max = J_Max+1.
:
: m
: is
: 里。

avatar
g*n
10
H1b可以有unpaid leave,但是雇主不得因为没活让雇员做而要求雇员take unpaid
leave。如果公司想让你坐冷板凳等活干,你又不愿离开公司,这个unpaid leave的理
由得编好。
不过说实话,有unpaid leave,USCIS如何知道都是个问题。
avatar
d*t
11
Is one single J_Max sufficient?
It needs to be an array J_Maxes instead of one single value J_Max, while
J_Maxes[i] means for each i, the largest J so far. For any given i, the
j_max value is always increasing, but not globally.

pair(a[i+1

【在 g*****i 的大作中提到】
: 据我所知,用max-heap做的办法(klgn) 是最efficient 办法了。为避免重复,必须用
: 个变量J-Max track 目前max-heap中所有pair的最大的j. 如果j < J_Max, insert
: pair(a[i+1],b[j])到heap里; 如果j = J_Max, 将 pair(a[i],b[j+1]) 和pair(a[i+1
: ],b[j]) insert到heap里, update as J_Max = J_Max+1.
:
: m
: is
: 里。

avatar
n*5
12
reverse sorted arrays 是不是可以 divide and conquer同时比较两个array的值..
. 例如:
a1b1可以比较a2<>= b2..
因为找Kth max,同时是reverse sorted.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。