Python Programming Contest
Brian Quinlan
brian at sweetapp.com
Tue Jul 19 04:52:42 EDT 2005
ThanhNam Nguyen wrote:
> Since my NNTP server doesnt allow posting, I'll ask you directly
> instead.
>
> Must I start from the first day?
No.
> For example:
>
> 1st day: A --> B 100 bucks
> 2nd day: A --> B 60 bucks
> 3rd day: A --> B 40 bucks
>
> What would the solution be? And for how much in total?
There are two correct solutions:
["A", "B"] # spend one night in A, then fly to B on day two (cost 80)
["A", "A", "B"] # spend two nights in A, then fly to B on day two
(cost 80)
Cheers,
Brian
More information about the Python-list
mailing list