Please read the new rule regarding the restriction on the use of AI tools. ×

A doubt that I badly want to clear.

Revision en4, by C_c-c_C, 2024-10-04 12:35:24

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
en6 English C_c-c_C 2024-10-04 12:50:41 3 Tiny change: 'clear.\n\nVladithur' -> 'clear.\n\n>vladithur'
en5 English C_c-c_C 2024-10-04 12:44:00 11 Tiny change: 't clear.\n' -> 't clear.\n\nVladithur'
en4 English C_c-c_C 2024-10-04 12:35:24 12 Tiny change: 't clear.\n\n@vladithur' -> 't clear.\n'
en3 English C_c-c_C 2024-10-04 12:35:03 26 Tiny change: 'clear.\n\n<blockquote>vladithur</blockquote>' -> 'clear.\n\n@vladithur'
en2 English C_c-c_C 2024-10-04 12:34:37 34 Tiny change: 'clear.\n\n' -> 'clear.\n\n<blockquote>vladithur</blockquote>'
en1 English C_c-c_C 2024-10-04 12:33:37 744 Initial revision (published)