Блог пользователя C_c-c_C

Автор C_c-c_C, история, 7 недель назад, По-английски

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

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
6 недель назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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