未来心不可得

2017年11月

November 12, 2017

Network Flow Template (SAP)

This algorithm was named for Shortest Augmenting Path (SAP).. From an OIer, at about year 2010.IntroductionTotal of n nodes, m edges.S is source node means 'source'.T is sink node means 'target'.m...
November 7, 2017

Treap

简介Treap is Tree + Heap, each node have two property : Key, and Priority.Using key can format the Binary tree, and using Priority can make a heap.代码struct Treap { int key,pri; int cnt; T...
November 5, 2017

Heap+Dijkstra

练习题:http://poj.org/problem?id=3169Dijkstra的过程InitializationSet dist[all]=∞ and set dist[S]=0; push S into Heap;Mainwhile (!heap.empty()) { HeapItem p=heap.pop(); if (dist[p] != p.distence) ...