Блог пользователя F__

Автор F__, история, 5 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор F__, история, 6 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится