inception_95's blog

By inception_95, history, 8 years ago, In English

Edit: AC

In this problem, one needs to compute Minimum spanning tree w query times! As running MST on the full graph every time will surely lead to TLE, my idea is to only work with the MST I get after each query! But it's unexpected for me to get MLE! I've just taken two adjacency list for only 205 nodes and simple a 205 size array. How can it lead to MLE? Plz help!

The full problem description can be found here: 1123 — Trail Maintenance

My Code

Thanks in Advance

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Try clearing memory by assigning null value to adjancency list variable and call System.gc() at the end of every test case.