Almost Union-Find problem solution, HELP

Правка en1, от ThirtyDays, 2020-12-29 14:34:51

Problem link In this all first and third operatio is same DSU. But in second operation move(a,b) we have to move elment a to grounp containing b.

My approach: Instead of changing parent structure, I am using a diffrent a vector parent2 for updating parent of element in move operation.

code. Code

I am getting wrong answer.

Теги #dsu, disjiont-set-union

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский ThirtyDays 2020-12-29 16:48:24 3 Tiny change: '/eGhngn)\n[Correct' -> '/eGhngn)\n.\n[Correct'
en4 Английский ThirtyDays 2020-12-29 16:47:56 43 Tiny change: '/eGhngn)\n\nI am ' -> '/eGhngn)\n[Correct code](https://ideone.com/ilHep5)\n\nI am '
en3 Английский ThirtyDays 2020-12-29 16:11:14 7 Tiny change: 'tunionfindhttp://)\nIn this' -> 'tunionfind)\nIn this'
en2 Английский ThirtyDays 2020-12-29 14:36:08 24
en1 Английский ThirtyDays 2020-12-29 14:34:51 466 Initial revision (published)