CantLoseNow's blog

By CantLoseNow, history, 2 years ago, In English

i was solving this problem 1738B - Prefix Sum Addicts . my submission 177418929 gives error on 1 testcase....help me please....otherwise i wont be able to move myself to other problems.

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it +10 Vote: I do not like it

Solve this question after some days with fresh mind.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Ok so your general idea is correct but the problem is that youre summing the whole remainder (your "disremain" variable) in the last number when you can sum 1 in the last "disremain" numbers.

  • »
    »
    2 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    LOVE U BRO!!! thanks for your time. i did that and it got accepted. by the way what should i do when i stuck like that another time?

    • »
      »
      »
      2 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Avoiding that kind of mistake is something that comes with time, but 2 things that help are either coding everything again but thinking about the logic again when you do it (specially for problems like this that are very short) or getting a code that ACed and comparing yours to it.