F__'s blog

By F__, history, 5 years ago, In English

These two solutions java(4532MB) cpp(18MB) of EDIST are same but java solution is taking 200 times more memory than cpp solution. Memory is mainly taken by dp array(you can take a quick view of the solutions). So my query is if an array is declared in java with new, will the memory be free after it's scope? Or for multiple test cases if in each test case array is declared with new, will the memory be free after each test case? And why it is happening for c++ and java solutions? I used System.gc() but it did not lessened the memory usage.

Full text and comments »

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

By F__, history, 5 years ago, In English

In this submission the program should terminates after executing the first if statement having 1000*1000 loop for test case 38. But getting TLE on test case 38. I can't find the reason. Can anyone explain the reason for me? Thanks in advance.

Full text and comments »

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