2012年9月29日

Ural 1519 Formula 1 (插头DP)

摘要: 1519. Formula 1Time Limit: 1.0 secondMemory Limit: 16 MBBackgroundRegardless of the fact, that Vologda could not get rights to hold the Winter Olympic games of 20**, it is well-known, that the city will conduct one of the Formula 1 events. Surely, for such an important thing a new race circuit shoul 阅读全文

posted @ 2012-09-29 23:25 kuangbin 阅读(2832) 评论(0) 推荐(1) 编辑

ZOJ 3466 The Hive II (插头DP)

摘要: The Hive IITime Limit: 5 Seconds Memory Limit: 65536 KBThere is a hive in the village. Like this. There are 8 columns(from A to H) in this hive. Different colums have the same number of grids. Every grid has its own coordinate, which is formed by two uppercases, representing the row index and the c. 阅读全文

posted @ 2012-09-29 21:01 kuangbin 阅读(833) 评论(0) 推荐(0) 编辑

二维凸包模板

摘要: #include<stdio.h>#include<math.h>#include<algorithm>#include<iostream>using namespace std;const int MAXN=1000;struct point{ int x,y;};point list[MAXN];int stack[MAXN],top;int cross(point p0,point p1,point p2) //计算叉积 p0p1 X p0p2 { return (p1.x-p0.x)*(p2.y-p0.y)-(p1.y-p0.y)*(p2 阅读全文

posted @ 2012-09-29 08:43 kuangbin 阅读(3073) 评论(0) 推荐(2) 编辑

最大流模板(SAP算法)(邻接表形式)

摘要: 最大流的SAP模板,用了很多次了。今天总结贴下(虽然代码不够精简,但是自己写的也总算看起来明白些,不容易错)据说没有可以卡SAP的最大流。。。const int MAXN=20010;//点数的最大值const int MAXM=880010;//边数的最大值const int INF=0x3f3f3f3f;struct Node{ int from,to,next; int cap;}edge[MAXM];int tol;int head[MAXN];int dep[MAXN];int gap[MAXN];//gap[x]=y :说明残留网络中dep[i]==x的个数为yint ... 阅读全文

posted @ 2012-09-29 08:34 kuangbin 阅读(3176) 评论(3) 推荐(0) 编辑

导航

JAVASCRIPT: