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

Method bfs

HackerEarth_problems/New Friends/solution.cpp:67–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 bool bfs() {
68 while (!q.empty()) {
69 int v = q.front();
70 q.pop();
71 for (int id : adj[v]) {
72 if (edges[id].cap - edges[id].flow < 1)
73 continue;
74 if (level[edges[id].u] != -1)
75 continue;
76 level[edges[id].u] = level[v] + 1;
77 q.push(edges[id].u);
78 }
79 }
80 return level[t] != -1;
81 }
82
83 long long dfs(int v, long long pushed) {
84 if (pushed == 0)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected