getting MLE in Lightoj 1123 — Trail Maintenance

Revision en4, by inception_95, 2016-12-22 08:52:00

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


  Rev. Lang. By When Δ Comment
en4 English inception_95 2016-12-22 08:52:00 12 Tiny change: 'In this pr' -> 'Edit: AC\n\nIn this pr'
en3 English inception_95 2016-12-22 08:37:01 1 Tiny change: 'in Advance.' -> 'in Advance' (published)
en2 English inception_95 2016-12-22 07:10:08 1 Tiny change: 'in Advance' -> 'in Advance.' (saved to drafts)
en1 English inception_95 2016-12-22 00:12:42 617 Initial revision (published)