标签:class blog code 2014 html set
const int maxn = 10010; int vis[maxn]; int y[maxn]; vector <int> G[maxn]; int n; bool dfs(int u) { for(int i = 0; i < G[u].size(); i++) { int v = G[u][i]; if(vis[v]) continue; vis[v] = true; if(y[v] == -1 || dfs(y[v])) { y[v] = u; return true; } } return false; } int match() { int ans = 0; memset(y, -1, sizeof(y)); for(int i = 0; i < n; i++) { memset(vis, 0, sizeof(vis)); if(dfs(i)) ans++; } return ans; }
标签:class blog code 2014 html set
原文地址:http://blog.csdn.net/u011686226/article/details/30285529