湖南纪委回应禁办生子祝寿宴:不接受可辞公职# Joke - 肚皮舞运动
m*c
1 楼
我在看bloomreach的opening的时候,看到这个puzzle,题目是wine testing。下面是
描述,链接在这个http://bloomreach.com/puzzles/
A large group of friends from the town of Nocillis visit the vineyards of
Apan to taste wines. The vineyards produce many fine wines and the friends
decide to buy as many as 3 bottles of wine each if they are available to
purchase. Unfortunately, the vineyards of Apan have a peculiar restriction
that they can not sell more than one bottle of the same wine. So the
vineyards come up with the following scheme: They ask each person to write
down a list of up to 10 wines that they enjoyed and would be happy buying.
With this information, please help the vineyards maximize the number of
wines that they can sell to the group of friends.
简单点说就是有很多的朋友想买酒,但是每种酒最多只能卖一次,一个人最多可以买三
种酒。题目给了每个人想买的酒的id,每个人最多想买10种。根据这个信息,问酒庄如
何可以卖出最多的酒。
我昨天想了想,觉得这个题目类似set cover或者set packing problem。解法的话就是
用greedy。但是总觉得不太好,不知道大家有没有更好的思路。
描述,链接在这个http://bloomreach.com/puzzles/
A large group of friends from the town of Nocillis visit the vineyards of
Apan to taste wines. The vineyards produce many fine wines and the friends
decide to buy as many as 3 bottles of wine each if they are available to
purchase. Unfortunately, the vineyards of Apan have a peculiar restriction
that they can not sell more than one bottle of the same wine. So the
vineyards come up with the following scheme: They ask each person to write
down a list of up to 10 wines that they enjoyed and would be happy buying.
With this information, please help the vineyards maximize the number of
wines that they can sell to the group of friends.
简单点说就是有很多的朋友想买酒,但是每种酒最多只能卖一次,一个人最多可以买三
种酒。题目给了每个人想买的酒的id,每个人最多想买10种。根据这个信息,问酒庄如
何可以卖出最多的酒。
我昨天想了想,觉得这个题目类似set cover或者set packing problem。解法的话就是
用greedy。但是总觉得不太好,不知道大家有没有更好的思路。