MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / flow

Method flow

HackerEarth_problems/New Friends/solution.cpp:103–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 }
102
103 long long flow() {
104 long long f = 0;
105 while (true) {
106 fill(level.begin(), level.end(), -1);
107 level[s] = 0;
108 q.push(s);
109 if (!bfs())
110 break;
111 fill(ptr.begin(), ptr.end(), 0);
112 while (long long pushed = dfs(s, flow_inf)) {
113 f += pushed;
114 }
115 }
116 return f;
117 }
118};
119int main()
120{

Callers 1

tcFunction · 0.80

Calls 2

bfsFunction · 0.85
dfsFunction · 0.50

Tested by

no test coverage detected