![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
poj
永远热血沸腾
这个作者很懒,什么都没留下…
展开
-
POJ1696 Space Ant 【凸包-ToLeft-Test】
#include<map>#include<set>#include<ctime>#include<cmath>#include<queue>#include<string>#include<vector>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<function原创 2017-04-16 20:40:15 · 384 阅读 · 0 评论 -
poj 2195 Going Home 最小费最大流
#include<stdio.h>#include<string.h>#include<vector>#include<queue>#include<algorithm>using namespace std;const int N=1024;const int inf=0x7fffffff;struct Edge{ int from,to,cap,flow,cost;}原创 2015-10-31 15:25:14 · 330 阅读 · 0 评论 -
poj 3026 Borg Maze 最小生成树prim
#include<stdio.h>#include<string.h>#include<iostream>#include<algorithm>#include<queue>using namespace std;const int inf=0x3f3f3f3f;const int N=4048;char mp[300][300];int ans,cnt,p[300][300],e原创 2015-10-30 15:30:17 · 388 阅读 · 0 评论 -
poj 1251 Jungle Roads 最小生成树
#include<stdio.h>#include<string.h>#include<iostream>#include<algorithm>using namespace std;const int inf=1<<24;int main(){ int n,i,j,k,e[50][50],u,v,w,low[50],ans; char s; while(~sca原创 2015-10-30 13:16:47 · 278 阅读 · 0 评论 -
poj 1751 Highways 最小生成树 prim
#include<stdio.h>#include<string.h>#include<math.h>#include<algorithm>#include<iostream>using namespace std;const int inf=0x3f3f3f3f;const int N=1024;bool vis[N];int dis[N];int e[N][N],a[N],b原创 2015-10-30 13:03:25 · 329 阅读 · 0 评论 -
poj 3694 Network 连通分量+LCA
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#in原创 2015-11-15 16:08:39 · 343 阅读 · 0 评论 -
poj 2349 Arctic Network 最小生成树第k大边-kruskal
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#in原创 2015-10-29 22:03:22 · 325 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers 线段树
...原创 2015-07-29 11:30:45 · 648 阅读 · 0 评论 -
poj 3177 Redundant Paths 强连通+并查集
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#in原创 2015-11-10 14:46:53 · 282 阅读 · 0 评论 -
poj 3264 Balanced Lineup 线段树
。。。原创 2015-07-28 10:06:52 · 575 阅读 · 0 评论 -
poj 2156 Minimum Cost 多次最大流最小费
#include<stdio.h>#include<string.h>#include<vector>#include<queue>#include<algorithm>using namespace std;const int N=8024;const int inf=0x7fffffff;struct Edge{ int from,to,cap,flow,cost;}原创 2015-11-07 15:08:28 · 407 阅读 · 0 评论 -
poj 1087 A Plug for UNIX 网络流
#include<stdio.h>#include<string.h>#include<queue>#include<vector>#include<map>#include<iostream>using namespace std;const int N=1024;const int inf=1<<24;struct Edge{ int from,to,cap,flow;原创 2015-11-06 14:55:30 · 265 阅读 · 0 评论 -
poj 2942 Knights of the Round Table 边连通分量+染色法
。。。原创 2015-09-18 07:03:45 · 229 阅读 · 0 评论 -
poj 1459 Power Network 网络流
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;using namespace std;using namespace std;const int N=1024;const int inf=1<<24;struct Edge{ int from,to,c原创 2015-11-05 19:26:49 · 306 阅读 · 0 评论 -
poj2528 Mayor's posters 线段树+离散化
。。。原创 2015-10-02 12:59:19 · 223 阅读 · 0 评论 -
poj 1966 Cable TV Network 顶点连通度-最大流
。。。原创 2015-09-08 09:23:16 · 299 阅读 · 0 评论 -
poj 1144 Network 图的连通性-关节点个数
。。。原创 2015-09-07 15:19:04 · 440 阅读 · 0 评论 -
poj 3020 Antenna Placement 二分匹配
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#in原创 2015-11-20 20:22:28 · 301 阅读 · 0 评论 -
poj 3281 Dining 最大流
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;const int N=1024;const int inf=1<<24;struct Edge{ int from,to,cap,flow;};vector<Edge>edges;vector<int原创 2015-10-31 14:32:16 · 310 阅读 · 0 评论 -
hdu 4292 Food 最大流
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;const int N=1024;const int inf=1<<24;struct Edge{ int from,to,cap,flow;};vector<Edge>edges;vector<int原创 2015-11-01 21:06:40 · 270 阅读 · 0 评论 -
POJ 3648 Wedding【2-sat O(n)】
#include<stdio.h>#include<string.h>#include<vector>#include<stack>#include<queue>#include<algorithm>using namespace std;const int N=2*(16000+5);const int B=2;const int W=1;stack<int>st;vecto原创 2016-07-15 10:52:57 · 272 阅读 · 0 评论 -
poj1185炮兵阵地【状压DP】
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int g[1024],num[1024],cnt,dp[105][70][70],p[105];char s[105][15];void init(int m){ cnt=0; int up=1<<m,f,sum=0;原创 2016-07-24 15:20:46 · 559 阅读 · 0 评论 -
poj1655 Balancing Act【树的重心+树形dp】
#include<stdio.h>#include<algorithm>#include<vector>#include<string.h>using namespace std;vector<int>g[20000+10];int son[20000+10],n,a,b,ans,mi;void dfs(int x,int fa){ int tmp=0; for(int原创 2016-07-01 16:21:02 · 283 阅读 · 0 评论 -
poj3683 Priest John's Busiest Day【2-sat n+m算法】
#include<stdio.h>#include<algorithm>#include<vector>#include<string.h>#include<math.h>using namespace std;const int N=1024;int mark[2*N],s[2*N],c,n,st[N][2],ed[N][2],t[N];vector<int>g[2*N];int原创 2016-07-13 10:00:30 · 395 阅读 · 0 评论 -
poj1159 Palindrome 【最长回文子序列】
时间复杂度度是n^2,空间复杂度必须优化到n才可以过。#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <mat原创 2016-06-08 09:34:43 · 564 阅读 · 0 评论 -
poj2763 Housewife Wind【树链剖分+线段树】
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <cmath>#inclu原创 2016-05-12 14:46:25 · 897 阅读 · 0 评论 -
poj3680 Intervals 【最小费用最大流+离散化】
#include<stdio.h>#include<string.h>#include<vector>#include<queue>#include<algorithm>using namespace std;const int N=5024;const int inf=0x7fffffff;struct Edge{ int from,to,cap,flow,cost;}原创 2016-05-05 19:33:05 · 466 阅读 · 0 评论 -
poj3237Tree 【树链剖分+线段树】
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <cmath>#inclu原创 2016-05-05 18:02:15 · 284 阅读 · 0 评论 -
poj2155 Matrix 【二维树状数组】
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>原创 2016-04-20 09:05:31 · 247 阅读 · 0 评论 -
poj 3261 Milk Patterns 可重叠的k次最长重复子串 后缀数组da算法
#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;const int maxn=2000000;int t1[maxn],t2[maxn],c[maxn];bool cmp(int *r,int a,int b,int l){ return r[a]==r[b]&&r[a+l]==r[原创 2015-12-03 22:41:53 · 266 阅读 · 0 评论 -
poj 1743 Musical Theme 后缀数组da算法
#include<stdio.h>#include<algorithm>#include<string.h>using namespace std;const int maxn=200000;int t1[maxn],t2[maxn],c[maxn];bool cmp(int *r,int a,int b,int l){ return r[a]==r[b]&&r[a+l]==r[原创 2015-12-03 20:39:12 · 304 阅读 · 0 评论 -
poj 2112 Optimal Milking 二分图多重匹配
#include<stdio.h>#include<string.h>#include<queue>#include<vector>#include<map>#include<iostream>using namespace std;const int N=1024*10;const int inf=10000000;struct Edge{ int from,to,cap原创 2015-11-26 22:00:58 · 279 阅读 · 0 评论 -
poj 2594 Treasure Exploration 二分匹配
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#in原创 2015-11-20 19:54:46 · 311 阅读 · 0 评论 -
poj 3189 Steady Cow Assignment 二分图多重匹配
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;const int N=1200;const int inf=1<<24;struct Edge{ int from,to,cap,flow;};vector<Edge>edges;vector<int原创 2015-11-26 19:29:08 · 268 阅读 · 0 评论 -
poj 2125 Destroying The Graph 最小点权覆盖集
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;const int N=1024;const int inf=1<<24;struct Edge{ int from,to,cap,flow;};struct node{ int num,st;原创 2015-11-18 21:14:52 · 417 阅读 · 0 评论 -
poj 2289 Jamie's Contact Groups 二分图多重匹配
#include<stdio.h>#include<string.h>#include<queue>#include<vector>using namespace std;const int N=2048;const int inf=1<<24;struct Edge{ int from,to,cap,flow;};vector<Edge>edges;vector<int原创 2015-11-23 13:15:22 · 581 阅读 · 0 评论 -
poj 1523 SPF 无向图关节点
。。。原创 2015-09-07 16:34:05 · 324 阅读 · 0 评论 -
poj 2553 The Bottom of a Graph 强连通Kosaraju
。。。原创 2015-09-11 15:14:12 · 261 阅读 · 0 评论 -
poj 3740 Easy Finding
dfs原创 2015-07-18 18:17:41 · 696 阅读 · 0 评论 -
poj 2656 Unhappy Jinjin
...原创 2015-07-18 18:19:31 · 563 阅读 · 0 评论