HKI Mock NOI 2015 problem — Graph ? Dynamic Connectivity ?

Revision en1, by tcknSS, 2020-07-09 13:51:03

Hello everyone ! I've just seen this 2 problem — B/Travel & C/Lilypads in HKI Mock NOI 2015 (seems like it's a Mock contest of Singaporean coders) but I couldn't find out any fast enough solutions for them.

Here are the links to the problems : B : https://dunjudge.me/analysis/problems/697/ C : https://dunjudge.me/analysis/problems/694/

In problem B, I tried to implement a lot of solutions (e.g. remove each edge and find the shortest path between two vertices that it connects, ...) but that is just enough to pass the first 4 subtasks (which helps me gain <= 50% of the points). In problem C, I think it's a kind of Dynamic Connectivity problem. I've heard about some data structures that can solve this problem. If my memory is correct, link-cut tree can solve it but many people say that it's really hard to code it in a contest. Now I'm really stuck and trying to find a help which could lead me to a bright future. Can you please tell me how can I solve these problems. Thank you !

Tags #graph, #dynamic connectivity

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English tcknSS 2020-07-09 13:53:39 159
en1 English tcknSS 2020-07-09 13:51:03 1066 Initial revision (published)