Mathematics, Competitive Programming, Philosophy, Discrete Mathematics.
contiguous unicoloured segments in that state. The cost c(o) of a stroke o is defined as the number of repaintings it induces. If the stroke o changes the state from s to s’ then its amortized cost a(o) is defined as the sum of its cost and the change in potential that it induces i.e.