Skip to content

Commit

Permalink
微不足道的更新
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolfx committed Oct 18, 2018
1 parent 2b4b8c8 commit 3827af3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions 3-图论.md
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,8 @@ void tarjan(int u, int fa) {
### 强连通分量缩点

```cpp
int low[N], dfn[N], clk, B, belong[N];
vector<int> Bc[N];
int low[N], dfn[N], clk, B, bl[N];
vector<int> bcc[N];
void init() { B = clk = 0; memset(dfn, 0, sizeof dfn); }
void tarjan(int u) {
static int st[N], p;
Expand All @@ -935,17 +935,14 @@ void tarjan(int u) {
if (dfn[u] == low[u]) {
while (1) {
int x = st[--p]; in[x] = false;
belong[x] = B; Bc[B].push_back(x);
bl[x] = B; bcc[B].push_back(x);
if (x == u) break;
}
++B;
}
}
```

+ 点双连通分量
+ 数组开两倍大,按照边数而不是点数开

### 点双连通分量 / 广义圆方树

+ 数组开两倍
Expand Down
1 change: 1 addition & 0 deletions 6-杂项.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,4 +537,5 @@ void init_stack(){
+ mid 用 `l + (r - l) / 2` 可以避免溢出和负数的问题
+ 小心模板自带的意料之外的隐式类型转换
+ 求最优解时不要忘记更新当前最优解
+ 图论问题一定要注意图不连通的问题

Binary file modified template.pdf
Binary file not shown.

0 comments on commit 3827af3

Please sign in to comment.