题目链接:uva 11748 - Rigging Elections
暴力枚举两人PK的胜负情况,由胜者向败者建一条有向边,从起点移动,如果可以覆盖所有点,即为yes
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int maxn = 105;
int N, M, S, W[maxn][maxn], V[maxn];
vector<int> G[maxn];
bool judge (int u, int v) {
int c = 0;
for (int i = 1; i <= M; i++)
if (W[i][u] < W[i][v])
c++;
return 2 * c > M;
}
void init () {
int x;
for (int i