Codeforces Notes
1114D: Flood Fill
By the rule, the final color must be either the leftmost color or the rightmost color, regardless of the starting point we picked.
cost(L,R, left) = 0 = cost(L,R, right) if [L, R] is within a seg already
cost(L, R, left) = min( cost(prevSegL, R, left), cost(prevSegL, R, right)) + 1
cost(L, R, right) = min( cost(L, prevSegR, left), cost(L, prevSegR, right)) + 1
459C: Pashmak and Buses
If we record the bus number for each students, this means that we can mark the arrangement as a k-based numbers!!!
This means that for each student, the condition translates to if there are two duplicates!!!
460C: Present
Bsearch on the min height, then scan from left to right to greedly assign bands