- 博客(4)
- 收藏
- 关注
原创 HDU3836 (求至少加几条边使其强连通分量为1)
Problem DescriptionTo prove two sets A and B are equivalent, we can first prove A is a subset of B, and then prove B is a subset of A, so finally we got that these two sets are equivalent. You are to ...
2018-06-30 19:14:57 210
原创 Tarjan算法
1.求有向图强连通分量个数 1.1vector模板#include<stdio.h>//此代码仅供参考,用于求一个图存在多少个强连通分量 #include<string.h> #include<vector> #include<algorithm> using namespace std; #define maxn 10000+5 vector...
2018-06-29 14:06:34 162
原创 HDU 1269 (Tarjan算法求有向图中强连通分量数目)
#include<bits/stdc++.h> #define maxn 10000+5 using namespace std; vector<int>mp[maxn]; int vis[maxn],dfn[maxn],low[maxn]; int n,m,cnt,sig; void init() { memset(low,0,sizeof(low)); memset(dfn,0,sizeof(dfn)); memset(vis,0,sizeof(vis)); for(i
2018-06-29 14:04:10 270
原创 字典树模板
数组模板#include<bits/stdc++.h> #define maxn 1<<20 using namespace std; int ch[maxn][26],cnt[maxn]; int id; void insert(char *str) { int rt = 0; int len = strlen(str); for...
2018-06-28 14:21:13 189
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人