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

Автор _Halim_, история, 7 лет назад, По-английски

I was trying to solve this problem in Egyptian ECPC but I couldn't. Can anyone give me a hint ?

someone who already solved it said that he use disjoint set but I couldn't handle it using disjoint set .

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

»
7 лет назад, # |
Rev. 4   Проголосовать: нравится +3 Проголосовать: не нравится

The problem is asking for the maximum spanning tree of the graph where the edge costs between any two numbers in the array is their gcd.

Solution