注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Question 4 — Lowest Cost Shirts
Objective
Suppose there is a sale on blue, green, and red shirts for the nextdays.
On day, it costs \(b_i\) dollars to buy a blue shirt, \(g_i\) dollars to buy a green shirt, and \(r_i\) dollars to buy a red shirt.
You wish to buy a single shirt for each of the nextdays, but with the caveat that you cannot buy the same color shirt on consecutive days.
Implementation 3
For inputs:- blue_costs = [100, 1, 76, 14]green_costs = [22, 20, 1, 2]red_costs = [99, 99, 5, 12]
复制代码 the output list should be:with a total cost of 30.
Limits
- Available RAM: 512MB Timeout: 6 seconds
- The program has to read inputs from standard input.
- The prm has to write the solution to standard output.
fu. ua3 |