Editorial for COCI '11 Contest 1 #3 X3
Submitting an official solution before solving the problem yourself is a bannable offence.
The first useful observation is that individual binary digits of the friendship value are mutually independent, so they can be considered separately. If the
A digit of the result is equal to
Let us denote by
to the sum of friendships, since that is exactly the number of pairs with differing digits in position
Comments