1.邻接表(vector向量法)
vector<int> G[N]; int Search_Path(int s) { for(int i=0;i<G[s].size();i++) { int v = G[s][i]; if(!vis[v]) { vis[v] = 1; if(match[v] == -1 || Search_Path(match[v])) { match[v] = s; return 1; } } } return 0; } //主函数中 for(i=0;i<=n;i++) G[i].clear(); memset(match,-1,sizeof(match)); cnt = 0; for(i=0;i<n;i++) { memset(vis,0,sizeof(vis)); if(Search_Path(i)) cnt++; }