Memory limit exceeded

Правка en1, от codevengers, 2023-12-07 10:50:19

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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский codevengers 2023-12-07 10:50:19 676 Initial revision (published)