自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

菜鸟成长ing

得之我幸,失之我命、

  • 博客(285)
  • 收藏
  • 关注

原创 poj-2479 Maximum sum DP

#include #include #include #include #include #include #include using namespace std; typedef __int64 LL; const int maxn = 50005; const int inf = 2000000001; int n; int num[maxn],ld[maxn],rd[maxn

2014-09-03 09:40:29 480

原创 hdu-3938 Portal 离线最小生成树

#include #include #include #include #include #include #include using namespace std; typedef __int64 LL; const int maxn = 50005; const int inf = 2000000001; int n,m,q; int p[maxn],r[maxn]; struc

2014-09-03 09:05:51 612

原创 hdu-3926 Hand in Hand 并查集

题目链接 #include #include #include #include #include #include #include using namespace std; typedef __int64 LL; const int maxn = 10005; const int Mod = 1000000007; int n1,m1,n2,m2; int p1[max

2014-08-16 23:32:08 600

原创 hdu-4946 Area of Mushroom 凸包

题目链接 #include #include #include #include #include #include #include using namespace std; typedef __int64 LL; const int maxn = 1005; const int Mod = 1000000007; int n,N; int ans[maxn]; int

2014-08-14 17:40:57 601

原创 hdu-1811 Rank of Tetris 并查集+拓扑

题目链接

2014-08-13 15:01:49 423

原创 poj-3368 Frequent values 线段树

题目链接 #include "stdio.h" #include "math.h" #include "string.h" #include "algorithm" using namespace std; const int maxn = 100005; int n,m,x,y,ans; int num[maxn]; struct node { int mmax,lmax,rmax;

2014-08-10 21:25:29 434

原创 Poj 3928 Ping pong 树状数组

题目链接 #include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 100005; const int Mod = 1000000007; int n; int c[maxn<<2]; struct Node { int id

2014-08-02 19:03:22 463

原创 hdu-4864 Task 2014多校联赛第一场 贪心

#include "stdio.h" #include "string.h" #include "queue" #include "iostream" #include "functional" #include "map" #include "algorithm" using namespace std; const int maxn = 100005; const int mod = 1000

2014-07-31 20:26:33 416

原创 poj-3723 Conscription 最大生成树

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 20005; const int Mod = 1000000007; int n,m,R,ans; int p[maxn]; struct node { int x,y,w; }

2014-07-31 20:02:10 448

原创 匈牙利算法

int nx,ny; int map[maxn][maxn]; int cx[maxn],cy[maxn]; bool vis[maxn]; int findpath( int u ) { for( int i = 1; i <= ny; i++ ) { if( map[u][i] && !vis[i] ) { vis[i] = 1; i

2014-07-31 18:59:30 488

原创 Hdu-4888 Redraw Beautiful Drawings 网络流

题目链接 #include "stdio.h" #include "queue" #include "iostream" #include "math.h" #include "algorithm" using namespace std; const int maxn = 1005; const int mod = 1000000007 ; const int inf = 1<<30;

2014-07-30 14:43:22 500

原创 POJ-2728 Desert King 01参数规划-最优比率生成树

#include "stdio.h" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 1005; const int mod = 1000000007 ; const int

2014-07-29 11:08:34 526

原创 poj-2349 Arctic Network 最小生成树

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; int s,n,m,c; double ans; struct Node { int x,y; }point[

2014-07-27 15:01:31 441

原创 poj-1789 Truck History 最小生成树

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 2005; const int Mod = 1000000007; const int inf = 1<<30; int n; char str[maxn][10]; bool v

2014-07-27 15:01:03 412

原创 poj-1287 Networking 最小生成树

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 55; const int Mod = 1000000007; int n,m,ans; struct node { int u,v,w; }edge[maxn*maxn]; i

2014-07-27 14:57:57 432

原创 poj-2524 Ubiquitous Religions 并查集

题目 #include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 50005; const int Mod = 1000000007; const int inf = 1<<30; int n,m; int p[maxn]; in

2014-07-27 14:54:59 456

原创 poj-3625 Building Roads kruskal

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; const int inf = 1<<30; int n,m,Max; int p[maxn]; bool vi

2014-07-27 14:51:56 655

原创 poj-3625 Building Roads

题目链接

2014-07-27 14:48:17 464

原创 poj-1679 The Unique MST 判断最小生成树是否唯一

#include "stdio.h" #include "string.h" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 105; const int mod = 1000

2014-07-27 14:45:09 453

原创 poj-1751 Highways 最小生成树

题目链接

2014-07-27 14:40:07 430

原创 poj-1988 Cube Stacking 带权并查集

题目链接

2014-07-27 14:36:06 421

原创 poj-1733 Parity game 并查集

题目链接

2014-07-27 14:28:37 433

原创 poj-1417 True Liars 并查集+DP

#include "stdio.h" #include "map" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 1005; const int mod = 10000000

2014-07-27 14:07:40 554

原创 Poj-2912 Rochambeau 枚举+并查集

#include "stdio.h" #include "map" #include "queue" #include "iostream" #include "functional" #include "math.h" #include "algorithm" using namespace std; const int maxn = 2005; const int mod = 10000000

2014-07-27 13:59:20 488

原创 hdu-4614 Vases and Flowers 成段更新

#include "stdio.h" #include "string.h" #include "queue" #include "vector" #include "algorithm" using namespace std; const int maxn = 50005; const int mod = 10007; const int inf = 1<<30; int n,m; int o

2014-07-19 17:12:31 445

原创 hdu-4578 Transformation 线段树成段更新

题意:有一个序列,有四种操作: 1:区间[l,r]内的数全部加c。 2:区间[l,r]内的数全部乘c。 3:区间[l,r]内的数全部初始为c。 4:询问区间[l,r]内所有数的P次方之和。 #include "stdio.h" #include "string.h" #include "queue" #include "vector" #include "algo

2014-07-19 14:43:12 474

原创 Toj 3345/hdu 1281 Chinese Chess 二分图匹配

#include "stdio.h" #include "string.h" #include "queue" #include "vector" #include "algorithm" using namespace std; const int maxn = 10005; const int inf = 1<<30; int n,m,k,st,ed; vectormap[maxn],map1

2014-07-18 23:22:46 496

原创 Poj-2289 Jamie's Contact Groups 多重二分图匹配

#include #include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Maxn = 505; const int Mod = 1000000007; const double inf = 1<<30

2014-07-18 20:02:28 659

原创 hdu-2819 Swap 二分图匹配

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 505; const int Mod = 1000000007; const double inf = 1<<30; int n,m; int map[maxn][maxn]; i

2014-07-18 15:05:11 454

原创 Poj-2060 Taxi Cab Scheme 二分图最小路径覆盖

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 505; const int Mod = 1000000007; const double inf = 1<<30; int n; int map[maxn][maxn]; str

2014-07-18 13:16:25 482

原创 Poj 3692 Kindergarten 二分图最大独立点集

题目链接

2014-07-17 22:08:58 459

原创 hdu 2389 Rain on your Parade 二分匹配 HK算法

题目链接 匈牙利算法

2014-07-17 20:43:03 458

原创 hdu 2444 The Accomodation of Students 二分图判断 + 最大匹配

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 205; const int Mod = 1000000007; int n,m; bool vis[maxn]; int cx[maxn],cy[maxn]; int map[m

2014-07-17 20:03:16 437

原创 hdu 2119 Matrix 二分图 最小点覆盖

题目链接

2014-07-17 19:59:38 429

原创 Uva 10369 Arctic Network 最小生成树

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1005; const int Mod = 1000000007; int s,n,m,c; double ans; struct Node { int x,y; }point[

2014-07-16 13:57:41 429

原创 Poj-2446 Chessboard 二分匹配

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 105; const int M = 50*50; const int Mod = 1000000007; int n,m,K; int nx,ny; int id[maxn][m

2014-07-14 14:42:44 448

原创 Uva 11402 Ahoy, Pirates! 线段树成段更新

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 1024005; const int Mod = 1000000007; int n,op,x,y; char str[maxn]; int p[maxn],temp[maxn];

2014-07-13 21:14:41 559

原创 ACdream 1020 The Game about KILL

#include #include #include #include #include using namespace std; typedef long long LL; const int maxn = 10005; const int Mod = 1000000007; int n,m,A; int main() { #ifndef ONLINE_JUDGE freo

2014-07-13 15:23:27 442

原创 约瑟夫环:递归算法

约瑟夫环:递归算法 假设下标从0开始,0,1,2 .. m-1共m个人,从1开始报数,报到k则此人从环出退出,问最后剩下的一个人的编号是多少? 现在假设m=10 0 1 2 3  4 5 6 7 8 9    k=3 第一个人出列后的序列为: 0 1 3 4 5 6 7 8 9 即: 3 4 5 6 7 8 9 0 1(*) 我们把该式转化为: 0 1 2 3 4 5 6 7

2014-07-13 15:21:48 613

原创 最短路题集

最短路 【HDU】 1548    A strange lift 基础最短路(或bfs)★ 2544    最短路    基础最短路★ 3790    最短路径问题 基础最短路★ 2066    一个人的旅行 基础最短路(多源多汇,可以建立超级源点和终点)★ 2112    HDU Today 基础最短路★ 1874    畅通工程续 基础最短路★ 1217    Arbitrag

2014-07-13 10:12:00 741

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除