- Problem 5 During The Shutdown Period Due To Covid 19 You Take A Job To Deliver Foods In Two Cities Fairfax And Richmo 1 (54.82 KiB) Viewed 15 times
Problem 5. During the shutdown period due to COVID-19, you take a job to deliver foods in two cities, Fairfax and Richmo
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Problem 5. During the shutdown period due to COVID-19, you take a job to deliver foods in two cities, Fairfax and Richmo
Problem 5. During the shutdown period due to COVID-19, you take a job to deliver foods in two cities, Fairfax and Richmond. In each city, you know how much you can earn by delivering food in each day. You can drive from one city to another at night but you have to take some time to rest so that you cannot work on the next day. The following is an example. 1 Fairfax Richmond Monday Tuesday Wednesday Thursday Friday $ 100 $ 90 $ 30 $ 30 $ 30 $ 20 $ 20 $ 90 $ 40 $90 A good strategy is to work at Fairfax on Monday, drive to Richomond at Monday night, rest at Richmond on Tuesday, and work at Richmod from Wednesday to Friday, with a total income of $100 + $90+ $40 + $90 = $320. Given a one-month table of earns on each day in each city, design an algo- rithm to maximize your income with running time O(n). a