Please read the new rule regarding the restriction on the use of AI tools. ×

doke_no_buggy's blog

By doke_no_buggy, history, 17 months ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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.