CSES - Police Chase
Author: Dong Liu
Time Complexity:
First, we run a max flow algorithm on the graph. Then, we run another BFS from node . If node is reachable but node is not and there was an edge , then we know that edge must be removed.
C++
#include <bits/stdc++.h>using namespace std;using ll = long long;using vi = vector<int>;#define f first#define s second#define pb push_back#define all(x) begin(x), end(x)
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!