I got interested in one problem. I have $N$ rocks, where rock with minimum weight have number equal to $1$, the next heaviest stone has a number equal to 2, etc..
So a rock with maximum weight have a number equal to $N$. And I have $N$ requests, each of N request contains two integers: $R$ $(1≤R≤N)$ and $S$ $(1≤S≤2)$. $R$ is the number of the stone that will be placed on the bowl $S$. All $R$ are different.
For each request I return $>$ if the left bowl is larger than the right, $<$ if the right bowl is larger than the left, $?$ if isn't possible determine that is bowl larger.
Constraint on $N$ is $(N < 10^5)$
For example, for input:
5 1 2 3 1 2 1 4 2 5 1
< > > ? >
I have no idea whatsoever how to solve this problem. But I wonder, that segment tree can be helpful, but I could not develop my idea.