由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - 请教一个关于算法的问题
相关主题
Help on a very simple question请教几个算法题, 第一个
Mapquest面试题,大伙儿看看出题了! std::copy()
如何找到两点之间所有的路径?socket接收方怎么知道数据接收完了?
几道算法题求教算法题求助
lp_solve 求救! divide by zero error :-(paper (SIAM. Comp) asked
HELP: A math problem问个算法题,给个简单的思路就好。
Re: 问两个低级mobile computing问题特朗普总统访谈录之中国南海
关于找最优的divide and conquer策略床铺的外交知识惊人
相关话题的讨论汇总
话题: trinkets话题: trinket话题: value话题: 2c话题: looted
进入CS版参与讨论
1 (共1页)
s*********x
发帖数: 17
1
Three treasure hunters need to divide up some trinkets that they have looted
. Assume that the total value of all trinkets is T, and that the value of
each trinket is less than or equal to c. Given a sequence of trinket values
x_1, ..., x_n, partition the trinkets into 3 (disjoint) sets such that the
value of all the trinkets in each set is between T/3 - 2c/3 and T/3 + 2c/3.
l*********y
发帖数: 1431
2
你需要生成均值是T/3,方差是2c/3的高斯分布.
s*********x
发帖数: 17
3
关键是需要证明这个是正确的。如果用greedy algorithm, 怎么证明这个是正确的。
l*********y
发帖数: 1431
4
保证每一步的|G1-G2|
s*********x
发帖数: 17
5
Three treasure hunters need to divide up some trinkets that they have looted
. Assume that the total value of all trinkets is T, and that the value of
each trinket is less than or equal to c. Given a sequence of trinket values
x_1, ..., x_n, partition the trinkets into 3 (disjoint) sets such that the
value of all the trinkets in each set is between T/3 - 2c/3 and T/3 + 2c/3.
l*********y
发帖数: 1431
6
你需要生成均值是T/3,方差是2c/3的高斯分布.
s*********x
发帖数: 17
7
关键是需要证明这个是正确的。如果用greedy algorithm, 怎么证明这个是正确的。
l*********y
发帖数: 1431
8
保证每一步的|G1-G2|
h**********g
发帖数: 3962
9
Here is a simple greedy algorithm.
Stage-0: Sorting the sequence into non-increasing order.
Therefore we can assume that
x_1 >= x_2 >= ... >= x_n.
Stage-1: Putting the next item into the lightest basket.
We use three baskets: A, B, C, which are initially
empty.
FOR i=1 TO n DO {
put x_i into the lightest basket
}
The proof of correctness is left as an ***individual homework***
for an undergraduate algorithms class.

looted
values
the

【在 s*********x 的大作中提到】
: Three treasure hunters need to divide up some trinkets that they have looted
: . Assume that the total value of all trinkets is T, and that the value of
: each trinket is less than or equal to c. Given a sequence of trinket values
: x_1, ..., x_n, partition the trinkets into 3 (disjoint) sets such that the
: value of all the trinkets in each set is between T/3 - 2c/3 and T/3 + 2c/3.

1 (共1页)
进入CS版参与讨论
相关主题
床铺的外交知识惊人lp_solve 求救! divide by zero error :-(
What Are Bird's Nest and Water Cube up to Now?HELP: A math problem
苹果不敢公布手表的销量Re: 问两个低级mobile computing问题
逼果子必须尽快改变管理班子和产品strategy关于找最优的divide and conquer策略
Help on a very simple question请教几个算法题, 第一个
Mapquest面试题,大伙儿看看出题了! std::copy()
如何找到两点之间所有的路径?socket接收方怎么知道数据接收完了?
几道算法题求教算法题求助
相关话题的讨论汇总
话题: trinkets话题: trinket话题: value话题: 2c话题: looted