OpenGenus/cosmos

Water Connection

Open

#6 215 ouverte le 13 oct. 2021

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)C++ (3 724 forks)batch import
Hacktoberfest

Métriques du dépôt

Stars
 (13 462 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur