As promised, here are some (nested) hints for Codeforces Round #682 (Div. 2).
Solve some small tests on paper.
Can you make the sum of each subarray equal to its length?
Suppose that the answer is
NO. Which property should hold for the array $$$a$$$?
What happens if $$$l_1 = r_1$$$?
The answer is
YES if there is a pair of equal elements in the array $$$b$$$. What happens if there are no equal elements?
Look at the binary representation of the sum of each subarray. Are there equal binary representations?
Solve on paper
3 3 1 1 1 1 1 1 1 1 1
3 3 2 1 1 1 1 2 2 1 2
Do a chess coloring on the grid. Can you make all differences odd?
How does the xor of all the array change after every operation?
The xor of all the array remains constant. Let it be $$$x$$$. If you make all elements equal, what's the xor of the resulting array?
If $$$n$$$ is even, $$$x = 0$$$. So the answer is
NO if the starting xor is not $$$0$$$.
If $$$n$$$ is odd, you can set $$$a[i] = x$$$ for each $$$i$$$, and their xor is $$$x$$$. The answer is always
In both cases, if the answer is
YES, you can solve the problem by making each $$$a[i]$$$ equal to $$$x$$$. Can you make $$$a = x$$$ first?
Now you want to "spread" $$$x$$$ in all the array. You already have some $$$a[i] = x$$$. Are there three indices such that $$$a[i] \oplus a[j] \oplus a[k] = x$$$?
I wasn't able to solve E and F. If you did, you may want to add your hints in the comments.
Also, please send a feedback if the hints are unclear or if they spoil the solution too much.