D - Remainder Reminder

  • image
  • Thoughts.
    • A naive search for a number that satisfies the condition is 10^10, no.
    • Calculated for each b
      • 0 if less than k
      • If larger, divide N by b ā†’ q, r
      • ret = q * (b - k)
      • If r > k, ret += r - k
  • Official Explanation OK
    • Thereā€™s one discrepancy, but Iā€™m sure it can be fixed quickly with a test case.

ARC091 ARC


This page is auto-translated from /nishio/ARC091B using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iā€™m very happy to spread my thought to non-Japanese readers.