2011年9月4日

并行排序算法【转】

摘要: 一、谁能把这个程序的性能提升一倍?---并行排序算法http://www.cnblogs.com/onlytiancai/archive/2009/04/21/1440829.html如下,一组4元矢量的排序,如何把排序时间缩减一半?可以用并行算法。using System;using System.Collections.Generic;using System.Diagnostics;namespace Vector4Test{ public class Vector { public double W; public double X; ... 阅读全文

posted @ 2011-09-04 23:31 龙豆 阅读(732) 评论(1) 推荐(1)

poj-1459 Power Network *

摘要: /* * 最大流 Edmonds-Karp * * 加入两个节点 S 和 T * S 与 所有 power stations相连 ; 所有 consumers 与 T 相连 * */#include <iostream>#include <cstring>using namespace std;const int inf = 100000000;const int maxN = 100 + 5;int n, np, nc, m, l[maxN][maxN], s, t;int q[maxN], maxFlow, pre[maxN];void addFlow(){ int 阅读全文

posted @ 2011-09-04 15:29 龙豆 阅读(330) 评论(0) 推荐(0)

sap算法详解与模板 [转]

摘要: 链接:1. Maximum Flow: Augmenting Path Algorithms Comparison http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=maxFlowRevisited2. 刘汝佳《算法艺术与信息学竞赛》 P321 ( 注: 上面的代码似乎有误,retreat()部分未回退< 详见下文or 链接1. > )---------------------------------------------关键概念与性质:距离函数(distance function),我们 阅读全文

posted @ 2011-09-04 14:55 龙豆 阅读(3185) 评论(0) 推荐(1)

导航