There are given $n$ balls. Their indexes: $\{1,...,n\}$.
Initially all of them are painted in $green$. (other possible color in my problem is $red$).
It is possible to paint interval of balls in color $red$ or $green$, for example $paint([a,b], green)$ - ball in given interval will be paint in green.
What's more, there are given $m\ge n$ operations of painting. After executing all $m$ painting our task is answer to question: What is color of ball $i$, where $i\in \{1,...,n\}$.
I can solve it by simple simulation coloring - I use BST interval tree. Hence, I get $O(m\lg n)$.
I am think about faster solution. It is my problem, indeed. It is easy to see that good idea is process operations in reverse order (from $m$ to $1$). Have you any idea ?