countdown's blog

By countdown, history, 7 years ago, In English

I have been trying to solve this on Codechef for some days but i donot find editorial pretty clear ...

** The problem statement goes as follows ** Chef has a sequence of N positive integers { a1, a2, a3, ... aN }. The Sous Chef wants to choose another sequence of N non-negative integers { b1, b2, b3, ... bN } such that

The bitwise xor sum of these 2 sequences is equal i.e, a1 ^ a2 ^ a3 ^ ... aN = b1 ^ b2 ^ b3 ^ ... bN for each i, bi ≤ ai.

** I am not getting how to avoid recounting of subsequences or to be more precise what does "one" or "zero" denote in editorial...so if someone could provide example to explain this(though there are few comments on editorial page but still if somebody can explain it better . ** ... please donot downvote it , I really want to solve this problem... thanks in advance

  • Vote: I like it
  • +2
  • Vote: I do not like it

| Write comment?