- 博客(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
435
原创 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
552
原创 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
553
原创 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
521
原创 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
392
原创 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
408
原创 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
376
原创 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
409
原创 匈牙利算法
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
435
原创 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
443
原创 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
471
原创 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
403
原创 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
366
原创 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
395
原创 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
419
原创 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
602
原创 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
422
原创 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
502
原创 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
445
原创 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
405
原创 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
430
原创 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
469
原创 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
575
原创 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
419
原创 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
442
原创 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
393
原创 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
384
原创 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
406
原创 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
497
原创 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
389
原创 约瑟夫环:递归算法
约瑟夫环:递归算法假设下标从0开始,0,1,2 .. m-1共m个人,从1开始报数,报到k则此人从环出退出,问最后剩下的一个人的编号是多少?现在假设m=100 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
578
原创 最短路题集
最短路【HDU】1548 A strange lift 基础最短路(或bfs)★2544 最短路 基础最短路★3790 最短路径问题 基础最短路★2066 一个人的旅行 基础最短路(多源多汇,可以建立超级源点和终点)★2112 HDU Today 基础最短路★1874 畅通工程续 基础最短路★1217 Arbitrag
2014-07-13 10:12:00
691
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人