Skip to content

Instantly share code, notes, and snippets.

@lyz05
lyz05 / 4253.cpp
Created December 26, 2015 06:38
tarjan
#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];
@lyz05
lyz05 / 3487.pas
Created December 25, 2015 11:06
剑与魔法(dragons)
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