- #1
SlurrerOfSpeech
- 141
- 11
I'm trying to solve a problem that amounts to:
Given b0, ..., bn-1 where1 <= bi, find the max of |a0 - a1| + |a1 - a2| + ... + |an-2 - an-1| where 1 <= ai <= bi.
I'm 100% confident that each ai is either 1 or bi.
I'm 90% confident that the elements a0, ..., an-1 are either
1, b0, 1, b1, ...,
or
b0, 1, b1, 1, ...
Are there any simple counterexamples?
Given b0, ..., bn-1 where1 <= bi, find the max of |a0 - a1| + |a1 - a2| + ... + |an-2 - an-1| where 1 <= ai <= bi.
I'm 100% confident that each ai is either 1 or bi.
I'm 90% confident that the elements a0, ..., an-1 are either
1, b0, 1, b1, ...,
or
b0, 1, b1, 1, ...
Are there any simple counterexamples?