Z10
Water Network Maximum Flow
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]]) -> intInput & 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-1Example 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: 10Example Test Scenarios (3)
Example 1
Input:
[4,[[0,1,10],[1,2,5],[0,2,8],[2,3,10]]]Expected Output:
10Example 2: 2 Düğüm 15 Kapasite
Input:
[2,[[0,1,15]]]Expected Output:
15Example 3: Üçgen Şebeke
Input:
[3,[[0,1,10],[0,2,10],[1,2,5]]]Expected Output:
15