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.

贡献者指南