Amalgamated Atrichokes

From programming_contest
Jump to navigation Jump to search

Go day by day and remember the highest price you've seen. If today is a new highest price, remember it. If today has a new greatest difference with the current highest price, remember it. I can't believe this was actually a world finals problem. I suppose this could be considered a DP....but what can't?