POI 2008 - Mafia
Author: Benjamin Qi
Similar to "POI - Spies." Maximum is easy. For minimum, we want to choose a subset of participants of maximum size such that no participant in the subset shoots at another. This can again be done with a greedy strategy.
#include <bits/stdc++.h>using namespace std;using ll = long long;using ld = long double;using db = double;using str = string; // yay python!using pi = pair<int, int>;using pl = pair<ll, ll>;
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!