原创 HDU 1896
題目: ***查看報名情況*** Stones Time Limit: 5000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total
原创 HDU 1678
Shopaholic Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 76
原创 heap+prim
#include<cstdio> #include<cstring> using namespace std; struct node {int n
原创 HDU 1272 拓撲排序
#include<iostream> #include<cstring> #include<cstdio> #include<queue> using namespace std; int p[100005]; int r[100005
原创 ZOJ2770 差分約束
#include<iostream> #include<cstring> #include<cstdio> using namespace std; #define EDGE_COUNT 30000 #define PNT_COUNT
原创 POJ 2516 最小費用流
做的第一個最小費用流問題,第一次忘了費用乘以流量 WA了一次,每次輸入一個矩陣都運行一次最小費用流即可。 #include<iostream> #include<cstring> #include<queue> #include<
原创 poj 1273 Ford_fulkerson
第一個網絡流題,雖水還是記念一下,因爲忘了將反向邊每次更新,無恥的貢獻了N次WA~用的是算法導論上的第一個算法,比較慢的Ford_fulkerson,廣搜找增廣路,每次記錄每個節點的前驅節點以到該節點路徑中的最小流#include<ios
原创 poj 1273 Dinic
#include<iostream> #include<queue> #include<cstring> #include<cstdio> using namespace std; #define MIN(a,b) (a)<(b)?(a
原创 Ford-furkson
int flow[205][205]; int cap[205][205]; int m,n;//m表示邊數,n表示點數,均從1開始 int ford_furkerson() { int ret=0; bool fl[205];
原创 poj 1087 a plug for unix
題目: A Plug for UNIX Time Limit: 1000MS Memory Limit: 65536K Total Submissi
原创 POJ 3272 cow traffic
題目: Cow Traffic Time Limit: 2000MS Memory Limit: 65536K Total Submissions:
原创 POJ 1273 一般性預流推進
#include<iostream> #include<cstdio> #include<cstring> using namespace std; #define MIN(a,b) (a)<(b)?(a):(b) int m,n;
原创 HRBEU 1121 二分枚舉
題目: Kth Largest TimeLimit: 1 Second MemoryLimit: 32 Megabyte Totalsubmit: 442 Accepted: 161 Description There are
原创 POJ 1966 點連通度
Cable TV Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 2912 Accepted: 1348 Descr
原创 poj 1935 journey 樹DP
Journey Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1425 Accepted: 523 Description There are n