idk321's blog

By idk321, history, 5 years ago, In English

I was wondering now for sometime why my graph solutions usually take much more memory than fairly similar solutions in java. The thing is, I have avoided arrays of arraylist since arrays cant be assigned generics (if you use (ArrayList) array, some sites dont even accept your solution, but I have only know found out that you can just leave it without assigning this and it works just fine), but I have now finally tried using this, look at the result of two almost identical programs, only one has list of lists while the other has array of lists: (list of lists)-https://codeforces.net/contest/1324/submission/78422102 (array of lists)-https://codeforces.net/contest/1324/submission/78422518. Anyone knows why is this the case?

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