dfsof's blog

By dfsof, history, 15 months ago, In English

Hello lady/bros, I am struggling with 100551E.Disconnected Graph.

I have considered: (1) Online fully dynamic graph connectivity. I copied a piece of code here: https://www.luogu.com.cn/problem/solution/P5247. I passed LuoguP5247 and SPOJDYNACON2, however I could not pass this problem;

SPOJ Code

Codeforces submission is similar, but it always gets TLE on test15, due to a relatively large constant:

Codeforces Disconnected Graph Submission

(2)Retractable DSU, however it seems that DSU only supports rolling back the add options, it cannot roll back delete operations...

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