Skip to content

Commit

Permalink
Create Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored Sep 14, 2019
1 parent d3ed9d8 commit 44d95c2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### 1168.Optimize-Water-Distribution-in-a-Village

此题的解法非常巧妙。你增加一个隐藏的0号节点,把每个节点自建井的费用wells[i]想象成连接[0,i]的边的费用。这样,这道题就变成了求最少的费用将所有的节点(包括隐藏的0号)连接起来。这就是最基本的最小生成树问题(MST),和```1135.Connecting-Cities-With-Minimum-Cost```一模一样。

0 comments on commit 44d95c2

Please sign in to comment.