Z10

Water Network Maximum Flow

Staff / Principal Engineer
Target Time: 40 - 50 Minutes
Type: NUMERIC

Problem Statement & Objective

Compute the maximum water throughput across a pipeline network from reservoir to city.

Function Signature (Python)

water_network_maximum_flow(n: int, lines: list[list[int]]) -> int

Input & Output Contract

Output Rule:Maksimum akış değeri. Yol yoksa 0.

System Constraints

2 <= n <= 200
0 <= hatlar.length <= 5000
1 <= kapasite <= 10^6
Kaynak 0, hedef n-1

Example Execution Walkthrough

n = 4, hatlar = [[0,1,10], [1,2,5], [0,2,8], [2,3,10]]
2->3 borusu kapasitesi 10 (hedefe giden tek geçit)
cevap: 10

Example Test Scenarios (3)

Example 1
Input:[4,[[0,1,10],[1,2,5],[0,2,8],[2,3,10]]]
Expected Output:10
Example 2: 2 Düğüm 15 Kapasite
Input:[2,[[0,1,15]]]
Expected Output:15
Example 3: Üçgen Şebeke
Input:[3,[[0,1,10],[0,2,10],[1,2,5]]]
Expected Output:15
Loading Python Editor...
Input Parameters
[
  4,
  [
    [
      0,
      1,
      10
    ],
    [
      1,
      2,
      5
    ],
    [
      0,
      2,
      8
    ],
    [
      2,
      3,
      10
    ]
  ]
]
Expected Output
10