Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя ThirtyDays

Автор ThirtyDays, история, 4 года назад, По-английски

Problem link In this all first and third operation is the same as DSU. But in the second operation move(a, b) we have to move element 'a' to group containing b.

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

Code. Code . Correct code

I am getting the wrong answer.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится