This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdio> | |
| #include <algorithm> | |
| #include <cstring> | |
| #include <cmath> | |
| #include <queue> | |
| using namespace std; | |
| const int N = 100000+10, M = 1000000+10; | |
| int ans[N],e[2][N],rd[N],next[2][M],to[2][M],v[N],h[N]; | |
| int dfn[N],low[N],col[N],stack[N],sum[N],f[N],tot[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const maxn=200000;oo=100000000; | |
| var i,j,n,size,last,t:longint; | |
| h:array[1..maxn] of longint; | |
| a:array[0..maxn,1..2] of longint; | |
| b:array[0..maxn] of longint; | |
| ch:char; | |
| ans:int64; | |
| procedure swap(var x,y:longint); | |
| var t:longint; | |
| begin |