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

Автор you_know_wh0, история, 5 лет назад, По-английски

i am getting negative value even after applying %M operation at all steps. i dont understand where i'm doing wrong//i wrote this code for C problem of today's contest-codeforces round #711

my code: my code

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

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

x=(x+M)%M; this will convert the negative value in to positive. Prove- x= x%M + M%M then M%M=0 so x=x%M;