codevengers's blog

By codevengers, history, 12 months ago, In English

This is my solution for problem. In this, why is it exceeding memory limit on test 34?In map f,on cumulative I've 2n numbers stored in it which is <=2e6,so 8*1e6 bytes required to store them.So,overall I'm using space required for initialization of the map(48 bytes for each initialization,so <=48*1e6),filling those maps(<=8*1e6) and initialization of count,count1,count2 and i(<=1e6*32 bytes). So, how is it exceeding 256MB memory limit?Is it temporaries required for recursion taking up such a large remaining space,or am i missing something?

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