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

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

Автор learner_cf, 9 лет назад, По-английски

Read full story here Your text to link here...

You given a undirected weighted graph. You have to select non overlapping edges(No two edges share same vertices) such that weight of selected edges is maximised.

Number of vertices < 200.

Input 7 9 (vertices, edges) 1 2 1 (from, to, weight) 1 4 1 1 6 1 3 2 3 3 4 9 3 6 1 5 2 3 5 4 3 5 6 1

Output 13 by taking edges (1-6) 1 + (3-4) 9 + (5-2) 3 = 13

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