barats's blog

By barats, history, 3 years ago, In English

I can't understand why my code is giving the memory limit exceeded on test case 2.

Here us the problem 1592C - Bakry and Partitioning

here is my code 130824440. Any suggestions?

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

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

.clear() clears the entire vector, leaving it at size 0. So you should resize each vector to $$$n+1$$$ or something before using it.