版本比较
【板子】
正文
增加 63 行删除 1 行
1,236 行未改动全部展开1237123812391240124112411242124312441245601 行未改动全部展开1847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916996 行未改动全部展开1,236 行未改动全部展开
return 0;}```## DIJ## Dijkstra```cpp#include <bits/stdc++.h>using namespace std;struct edge601 行未改动全部展开 } return 0;}```## 二分图匹配```cpp#include <bits/stdc++.h>using namespace std;#define ll long long#define db double#define pii pair<int,int>#define mp make_pair#define fi first#define se secondconst int N=505;int mch[N];bool vis[N];vector<int> g[N];
bool dfs(int u){ for(int v : g[u]) { if(!vis[v]) { vis[v]=1; if(!mch[v] || (mch[v] && dfs(mch[v]))) { mch[v]=u; return 1; } } } return 0;}signed main(){ int sti=clock();
// freopen(".in","r",stdin);// freopen(".out","w",stdout); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,m,e; cin>>n>>m>>e; for(int i=1;i<=e;i++) { int u,v; cin>>u>>v; g[u].push_back(v); } int ans=0; for(int i=1;i<=n;i++) { memset(vis,0,sizeof vis); if(dfs(i)) ans++; } cout<<ans<<endl;// cerr<<1.0*(clock()-sti)/CLOCKS_PER_SEC<<endl; return 0;}
```
# STRING## KMP```cpp#include <bits/stdc++.h>996 行未改动全部展开