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

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

My solution involving prim's algorithm 145857604 gives wrong answer for this problem : 1513D - GCD and MST I understand the Kruskal's algorithm solution mentioned in the editorial, but cannot figure out why prims is failing here.

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

»
2 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

Try this testcase:

1
3 1000
6 3 2

Correct answer :- 1003