OpenGenus/cosmos

Water Connection

Open

#6,215 建立於 2021年10月13日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)C++ (3,724 fork)batch import
Hacktoberfest

倉庫指標

Star
 (13,462 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

This is a(n):

  • New algorithm
  • Update to an existing algorithm
  • Error
  • Proposal to the Repository

Details:

You are given two integers n and p denoting the number of houses and the number of pipes. The connections of pipe among the houses contain three input values: a_i, b_i, d_i denoting the pipe of diameter d_i from house a_i to house b_i.

also, consider:

  • Every house in the colony has at most one pipe going into it and at most one pipe going out of it.
  • Tanks and taps are to be installed in a manner such that every house with one outgoing pipe but no incoming pipe gets a tank installed on its roof.
  • every house with only an incoming pipe and no outgoing pipe gets a tap.

you have to find out the efficient solution for the network.

貢獻者指南