![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
急求翻译英语!!
Problem13:ToyShopping[DamonDoucet,2010]Bessiewantssometoys.She'sbeensavingherallowanc...
Problem 13: Toy Shopping [Damon Doucet, 2010]
Bessie wants some toys. She's been saving her allowance for years,
and has an incredibly huge stash. However, she is quite frugal and
wants to get the best value for her cash. In fact, she has decided
only to buy exactly three different toys of the N (3 <= N <= 25,000)
offered at the Bovine Plaything Palace.
Toy i brings Bessie J_i (0 <= J_i <= 1,000,000) microbundles of joy
and has price P_i (0 < P_i <= 100,000,000). Bessie has enough money
to buy any three toys that she chooses.
Bessie wants to maximize the sum of her happy-frugal metric (which
is calculated as J_i/P_i -- joy divided by price) for the three
toys she chooses. Help Bessie decide which toys she should buy.
The answer is guaranteed to be unique.
Assume that the Bovine Plaything Palace offers 6 different toys for
Bessie:
i Joy Price Happy-Frugal Metric
- --- ----- -------------------
1 0 521 0.00000
2 442 210 2.10476...
3 119 100 1.19000
4 120 108 1.11111...
5 619 744 0.83198...
6 48 10 4.80000
Bessie would choose toy 6 (HFM = 4.80), toy 2 (HFM = 2.10), and toy
3 (HFM = 1.19).
PROBLEM NAME: toyshop
INPUT FORMAT:
* Line 1: A single integer: N
* Lines 2..N+1: Line i+1 contains two space-separated integers: J_i
and P_i
SAMPLE INPUT (file toyshop.in):
6
0 521
442 210
119 100
120 108
619 744
48 10
OUTPUT FORMAT:
* Line 1: The total price that Bessie will have to pay
* Lines 2..4: In descending order sorted by the happy-frugal metric,
the 1-based index of the toys that Bessie should buy, one per
line
SAMPLE OUTPUT (file toyshop.out):
320
6
2
3 展开
Bessie wants some toys. She's been saving her allowance for years,
and has an incredibly huge stash. However, she is quite frugal and
wants to get the best value for her cash. In fact, she has decided
only to buy exactly three different toys of the N (3 <= N <= 25,000)
offered at the Bovine Plaything Palace.
Toy i brings Bessie J_i (0 <= J_i <= 1,000,000) microbundles of joy
and has price P_i (0 < P_i <= 100,000,000). Bessie has enough money
to buy any three toys that she chooses.
Bessie wants to maximize the sum of her happy-frugal metric (which
is calculated as J_i/P_i -- joy divided by price) for the three
toys she chooses. Help Bessie decide which toys she should buy.
The answer is guaranteed to be unique.
Assume that the Bovine Plaything Palace offers 6 different toys for
Bessie:
i Joy Price Happy-Frugal Metric
- --- ----- -------------------
1 0 521 0.00000
2 442 210 2.10476...
3 119 100 1.19000
4 120 108 1.11111...
5 619 744 0.83198...
6 48 10 4.80000
Bessie would choose toy 6 (HFM = 4.80), toy 2 (HFM = 2.10), and toy
3 (HFM = 1.19).
PROBLEM NAME: toyshop
INPUT FORMAT:
* Line 1: A single integer: N
* Lines 2..N+1: Line i+1 contains two space-separated integers: J_i
and P_i
SAMPLE INPUT (file toyshop.in):
6
0 521
442 210
119 100
120 108
619 744
48 10
OUTPUT FORMAT:
* Line 1: The total price that Bessie will have to pay
* Lines 2..4: In descending order sorted by the happy-frugal metric,
the 1-based index of the toys that Bessie should buy, one per
line
SAMPLE OUTPUT (file toyshop.out):
320
6
2
3 展开
展开全部
问题13:玩具买东西,2010年的大门还有]
贝西想要的玩具。她被拯救她零用钱多年,
和有一个令人难以置信的巨大的珍藏。然而,她很节俭
想要得到最好的价值为她的现金。事实上,她已决定了
只买玩具的确切三个不同氮(3 < = N < = 25,000)。
在牛的玩物宫。
我带来了贝茜J_i玩具(0 < = J_i < = 1000万)microbundles欢乐
P_i和价格(0 < P_i < = 10万元)。贝西有足够的钱
买任何三玩具,她选择。
贝西想最大限度的总和happy-frugal度量(她
作为J_i / P_i计算——快乐除以价格)为3
玩具就嫁谁。贝茜决定哪些帮助她应该买玩具。
答案是保证是独一无二的。
假设牛玩具宫殿提供6个不同的玩具
贝茜:
我快乐的价格Happy-Frugal度量
————————————————————————————
1 0以至于0.00000
2 442 210 2.10476……
3 119 100 1.19000
4 1.11111 120 108……
5 619 744 0.83198……
10 4.80000六48岁
贝茜会选择玩具6(间歇=需要花费4.8),玩具(2)、(2.10性感的玩具
3(间歇= 1.19)。
问题的名字:玩具店
输入格式:
第1行:* * *:一个整数
2 . *线N + 1:行,我+ 1包含两个space-separated:J_i整数
P_i,
toyshop.in输入(文件)的样品。
6
0以至于
66 210
119 100
120 108
619 744
48 10
输出的格式:
第1行:*总价,贝茜将不得不支付
2 . . 4:*线依次排序的happy-frugal度量,
这个1-based指标的玩具,贝茜应该买一
线
输出文件toyshop.out样品)。
320
6
2
3
贝西想要的玩具。她被拯救她零用钱多年,
和有一个令人难以置信的巨大的珍藏。然而,她很节俭
想要得到最好的价值为她的现金。事实上,她已决定了
只买玩具的确切三个不同氮(3 < = N < = 25,000)。
在牛的玩物宫。
我带来了贝茜J_i玩具(0 < = J_i < = 1000万)microbundles欢乐
P_i和价格(0 < P_i < = 10万元)。贝西有足够的钱
买任何三玩具,她选择。
贝西想最大限度的总和happy-frugal度量(她
作为J_i / P_i计算——快乐除以价格)为3
玩具就嫁谁。贝茜决定哪些帮助她应该买玩具。
答案是保证是独一无二的。
假设牛玩具宫殿提供6个不同的玩具
贝茜:
我快乐的价格Happy-Frugal度量
————————————————————————————
1 0以至于0.00000
2 442 210 2.10476……
3 119 100 1.19000
4 1.11111 120 108……
5 619 744 0.83198……
10 4.80000六48岁
贝茜会选择玩具6(间歇=需要花费4.8),玩具(2)、(2.10性感的玩具
3(间歇= 1.19)。
问题的名字:玩具店
输入格式:
第1行:* * *:一个整数
2 . *线N + 1:行,我+ 1包含两个space-separated:J_i整数
P_i,
toyshop.in输入(文件)的样品。
6
0以至于
66 210
119 100
120 108
619 744
48 10
输出的格式:
第1行:*总价,贝茜将不得不支付
2 . . 4:*线依次排序的happy-frugal度量,
这个1-based指标的玩具,贝茜应该买一
线
输出文件toyshop.out样品)。
320
6
2
3
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2010-07-28
展开全部
问题13:玩具购物[达蒙多塞特,2010]
贝西想要一些玩具。她一直保存多年她的津贴,
并有一个令人难以置信的巨大的藏匿处。不过,她很节俭
想要得到她的最好的现金价值。事实上,她已经决定
正是三只买了N(3 <= N的<不同的玩具= 25000)
提供在牛玩物宫。
我带来了贝西J_i玩具(0 <= J_i <= 1,000,000)的喜悦microbundles
并且价格P_i(0 <P_i <= 100,000,000)。贝西有足够的钱
购买任何3的玩具,她选择。
贝西要最大限度地发挥她的快乐,节俭度量(其中的总和
计算公式为J_i / P_i - 按价格划分的喜悦)为3
她选择玩具。贝西决定帮助她应该买哪些玩具。
答案是保证是独一无二的。
假设该牛玩物Palace酒店提供6种不同的玩具
贝西:
我喜悦价格快乐俭朴公制
- --- ----- -------------------
1 0 521 0.0
贝西想要一些玩具。她一直保存多年她的津贴,
并有一个令人难以置信的巨大的藏匿处。不过,她很节俭
想要得到她的最好的现金价值。事实上,她已经决定
正是三只买了N(3 <= N的<不同的玩具= 25000)
提供在牛玩物宫。
我带来了贝西J_i玩具(0 <= J_i <= 1,000,000)的喜悦microbundles
并且价格P_i(0 <P_i <= 100,000,000)。贝西有足够的钱
购买任何3的玩具,她选择。
贝西要最大限度地发挥她的快乐,节俭度量(其中的总和
计算公式为J_i / P_i - 按价格划分的喜悦)为3
她选择玩具。贝西决定帮助她应该买哪些玩具。
答案是保证是独一无二的。
假设该牛玩物Palace酒店提供6种不同的玩具
贝西:
我喜悦价格快乐俭朴公制
- --- ----- -------------------
1 0 521 0.0
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |