_Halim_'s blog

By _Halim_, history, 13 days ago, In English,

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

someone who already solved said that he use disjoint set but I can't deal with it using disjoint set .

 
 
 
 

»
12 days ago, # |
Rev. 4   Vote: I like it +3 Vote: I do not like it

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