A doubt that I badly want to clear.

Revision en1, by C_c-c_C, 2024-10-04 12:30:26

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.

Tags vladithur

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English C_c-c_C 2024-10-04 12:30:26 744 Initial revision (published)