Блог пользователя doke_no_buggy

Автор doke_no_buggy, история, 3 года назад, По-английски

Can someone explain why my solution for the question 1709D - Rorororobot is giving wrong answer for test case 9 submission 203589041 . Any help is appreciated.

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

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

The logic for req_ht near the end is wrong. Here's your code slightly modified: https://mirror.codeforces.com/contest/1709/submission/203607093

Your code is wrong on the right side. Lets say maxi-xs is 4 and k is 3. In this case req_ht should be 6, but your code gives 5. You need k minus what your code has, and then need to account for if maxi-xs mod k is 0.