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

Автор Rahil_gupta, 6 часов назад, По-английски

Hi! I was trying this problem In this problem E-decode of round 962 (1996E - Decode) , when I was using a long long type "variable sum" while going from left to right (297131526) it was giving wrong answer on test case 6. But when I switched to an "suffix array sums" (297132422) it is Accepted, even though both sums array and variable sum are equivalent. I cannot understand this and I know I might be missing something silly and, but still any help is highly appreciated. THANK YOU VERY MUCH!!!!

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

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

Auto comment: topic has been updated by Rahil_gupta (previous revision, new revision, compare).

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

you have to initialize the value for accumulate function as $$$0ll$$$ not $$$0$$$ (to consider it as long long), I changed it in the first code and it got accepted 297136677

  • »
    »
    6 часов назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thank You very much, will have to keep small things in check next time. But again thank you very much.