C_c-c_C's blog

By C_c-c_C, history, 5 weeks ago, In English

Can you please explain how to prove the bonus points in the editorial of this question: Problem — 1632C — Codeforces

In Bonus 2: It is optimal to have a'=a or b'=b. This implies that if a'=a, we are only increasing b by 1 until b becomes a supermask of a and then we do the OR operation. And if b'=b, we are only increasing a until it becomes a submask of b and then we do the OR operation. My doubt is why only incrementing either a or b before the OR operation will suffice for the ans. Why do we not consider incrementing both a and b before doing the OR operation for the optimal answer?

Please explain, I've been scratching my head over this really long but couldn't get it clear.

Vladithur

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

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by C_c-c_C (previous revision, new revision, compare).