A doubt that I badly want to clear.

Правка en2, от C_c-c_C, 2024-10-04 12:34:37

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
Теги vladithur

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en7 Английский C_c-c_C 2024-10-14 02:32:05 19 Tiny change: 'clear.\n\n>vladithur' -> 'clear.\n\n[user:vladithur]'
en6 Английский C_c-c_C 2024-10-04 12:50:41 3 Tiny change: 'clear.\n\nVladithur' -> 'clear.\n\n>vladithur'
en5 Английский C_c-c_C 2024-10-04 12:44:00 11 Tiny change: 't clear.\n' -> 't clear.\n\nVladithur'
en4 Английский C_c-c_C 2024-10-04 12:35:24 12 Tiny change: 't clear.\n\n@vladithur' -> 't clear.\n'
en3 Английский C_c-c_C 2024-10-04 12:35:03 26 Tiny change: 'clear.\n\n<blockquote>vladithur</blockquote>' -> 'clear.\n\n@vladithur'
en2 Английский C_c-c_C 2024-10-04 12:34:37 34 Tiny change: 'clear.\n\n' -> 'clear.\n\n<blockquote>vladithur</blockquote>'
en1 Английский C_c-c_C 2024-10-04 12:33:37 744 Initial revision (published)