由买买提看人间百态

topics

全部话题 - 话题: uppbound
(共0页)
b******b
发帖数: 713
1
来自主题: JobHunting版 - 求问Jane Street一道面试题
binary search,
int lowbound = 0, uppbound =n;
int mid = (lowbound + uppbound) / 2;
int countLowHalf=0, countUpperHalf = 0;
now go through the list and count how many in lower half, how many in
upperhalf, and update the low/upper bound to the part which has count > n/2.
since each time we reduce the range by 2, so need longn steps to get to the
bottom, and each step need to loop through the whole array, so it's nlogn.
not sure if there is O(n) algorithm.

n=
s*****n
发帖数: 5488
2
来自主题: JobHunting版 - 再问一道ms的面试题
花了5分钟想了一下多少种assignment.
假设P都是slave.每天都要work, like us.则,对于 T进行标记p1, p2, etc.
则for every day 组合数位C^N(P)^(T)。
summing up until for all SUM(labor(T)) <= sum(sum labor(p) on T)
这应该是一个uppbound.
考我这道题估计当场要挂掉了。
(共0页)