Comments
0

Can you list some of the strategies.

+3

Is there a way to sort comments in descending order, so I can look at the discussion of the problems.

can you explain why

(Note that only even number of such 0 must be flipped on, though)

i also implemented exact similar way, we are correct if k = 2, our assumption that taking k-2 n's is wrong , we just have to extend our logic for k whatever we implemented for k=2

Thankyou brother, got it:)

Can someone explain me ,I have some doubt in 1875C — Jellyfish and Green Apple

I got till this part So we can uniquely find a set of positive integers S satisfying nm=∑i∈S12i

But how we get the answer by ,what is the logic We can use std::__builtin_popcount() to get |S|, the answer is m×|S|−n.

And moreover since we devided n and m by gcd(n,m), so first ideally we should compute no of operation for one group(the group we get by deviding m by gcd(m,n)) and then multiply that with gcd(n,m) to get the total operation.