OpenGenus/cosmos

Water Connection

Open

#6,215 opened on Oct 13, 2021

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C++ (3,724 forks)batch import
Hacktoberfest

Repository metrics

Stars
 (13,462 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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.

Contributor guide