Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

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
  • Проголосовать: не нравится

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

The logic for req_ht near the end is wrong. Here's your code slightly modified: https://codeforces.me/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.