题目链接:hdu 5154 Harry and Magical Computer
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 105;
int N, M, s[maxn], v[maxn];
vector<int> g[maxn];
void init () {
int a, b;
memset(s, 0, sizeof(s));
memset(v, 0, sizeof(v));
for (int i = 0; i <= N; i++)
g[i].clear();
for (int i = 0; i < M; i++) {
scanf("%d%d", &a, &b);
g[b].push_back(a);
s[a]++;
}
}
int find () {......
阅读全文