killcode's blog

By killcode, history, 7 years ago, In English

I am having trouble at 828C - String Reconstruction , getting memory limit exceeded at this code 28500560 . Any help ? Thanks in Advance.

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

| Write comment?
»
7 years ago, # |
  Vote: I like it +5 Vote: I do not like it

Let's consider about this case:

1
1000000 aaaaaaa...aaaaaaa 1 2 3 4 5 ... 999998 999999 1000000 (string is length 1000000)

In this case your code puts 1000000 strings of length 1000000 in vector v, so your code uses 1000000*1000000 = 1TB. I think this is why the code is MLE.