自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 资源 (4)
  • 收藏
  • 关注

原创 POJ 2112 Optimal Milking 二分图多重匹配 网络流+Floyd+二分

超级经典的一道题目。。竟然1A 了,

2014-07-31 11:48:02 516

原创 POJ 1274 The Perfect Stall 二分图最大匹配

这两天被线段树懒惰标记搞得

2014-07-30 16:43:38 377

原创 hdu 4893 Wow! Such Sequence! 线段树单点更新+区间更新+区间查询

//1312MS 4668K#include #include #include #include using namespace std;typedef long long ll;const int M=90;const int N=100005;ll f[100],sum[N<<2],need[N<<2];bool lazy[N<<2];inline ll Find(

2014-07-30 13:33:02 428

原创 hdu 1532 Drainage Ditches 最大流 水题

//0MS 268K#include #include #include #include #include #include using namespace std;struct edge{ int to, cap, rev; edge(int to, int cap, int rev) : to(to), cap(cap), rev(rev)

2014-07-27 16:39:21 339

转载 POJ 3155 Hard Life 最大密度子图

题目大意:给出一个无向连通图, 找出一个子图,使该子图的边数与点数的比值最大。(最大密度子图)

2014-07-27 11:14:07 396

原创 poj 2914 Minimum Cut 求无向图的最小割 Stoer-Wagner算法模板

用求最大流的方法去求最小割,C(n,2)枚举

2014-07-26 20:42:46 467

原创 hdu 3549 Flow Problem (第二篇) Dinic算法 最大流问题

加了一个预处理的bfs优化,这个算法更快

2014-07-25 20:28:13 381

原创 hdu 3549 Flow Problem 最大流模板题 Ford-Fulkerson算法

好久都没在杭电上做题了。。裸的最大流模板题。。

2014-07-25 17:15:29 437

原创 POJ 3255 Roadblocks 次短路

求次短路,模板题//2788K 235MS#include #include #include #include #include #include using namespace std;typedef pair pii;const int maxn = 5000;const int maxm = 100000;const int inf = 0x7fffffff;ve

2014-07-24 11:30:30 379

原创 POJ 2377 Bad Cowtractors

最大生成树//376K 32MS#include #include #include #include using namespace std;struct edge{ int u, v, cost; edge(int u=0, int v=0, int cost=0) : u(u), v(v), cost(cost){ }};const int max

2014-07-23 17:08:48 344

原创 POJ 3268 Silver Cow Party

给出n个点和m条边,接着是m条边,代表从牛a到牛b需要花费c时间,现在所有牛要到牛x那里去参加聚会,并且所有牛参加聚会后还要回来,给你牛x,除了牛x之外的牛,他们都有一个参加聚会并且回来的最短时间,从这些最短时间里找出一个最大值输出

2014-07-23 11:11:11 376

原创 POJ 3259 Wormholes

题意是判断一个有向图是否存在负环。

2014-07-22 11:44:04 318

原创 POJ Six Degrees of Cowvin Bacon

刷点水题,调整一下心情

2014-07-21 17:13:33 426

原创 POJ 1703 Find them, Catch them 二分图 并查集

//636K 313MS#include const int N = 100005;int n, m, f[N];bool rank[N];inline void init(){ for(int i=1; i<=n; ++i){ f[i]=i; rank[i]=0; //初始化所有点都在二分图的一边 }}int find(int

2014-07-21 00:34:17 429

原创 POJ 2236 Wireless Network 并查集

裸的并查集问题,我是用的可行数组存的,至于

2014-07-20 15:36:25 358

原创 POJ 3614 Sunscreen 贪心 优先队列

这题的模型是给你一些线段和一些点,每个点的使用次数都是有一定限制的,每条线段只能被标记一次,求最多有多少条线段被标记。将奶牛按照阳光强度的最小值从小到大排序。将防晒霜也按照能固定的阳光强度从小到大排序从最小的防晒霜枚举,将所有符合  最小值小于等于该防晒霜的 奶牛的 最大值 放入优先队列之中。然后优先队列是小值先出所以就可以将这些最大值中的最小的取出来。更新答案。

2014-07-19 14:56:55 402

原创 POJ 2386

//160K 16MS#include #include #include #include using namespace std;struct point{ int x, y;};const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};b

2014-07-18 16:52:30 356

原创 POJ 3253 Fence Repair 霍夫曼树 贪心 优先队列

非常经典的一道

2014-07-18 16:15:07 512

原创 CodeForces 2014.7.17 D. Multiplication Table

该函数f(i, j) = i*j沿x方向和y方向都是单调递增的,故考虑用二分求解

2014-07-18 14:41:03 382

原创 POJ 3069 Saruman's Army 线段的覆盖 贪心

把做过的题写一写吧

2014-07-18 00:44:23 394

原创 POJ 2480 Longge's problem 欧拉函数的应用 积性函数

找时间把题解补上//176K 157MS#include #include #include using namespace std;typedef long long ll;ll F(ll n){ ll m = sqrt(n+0.5); ll ans = n; for(ll i=2; i<=m; ++i) if(n % i == 0){

2014-07-17 16:23:06 392

原创 POJ 3050 Hopscotch DFS

//516K 63MS#include #include #include #include using namespace std;int a[6][6];bool vis[6][6];const int dx[4] = {1, 0, -1, 0};const int dy[4] = {0, 1, 0, -1};set s;int num;inline bool ok

2014-07-17 10:32:43 367

原创 POJ 3187 Backward Digit Sums

暴力搜索//156K 0MS#include #include #include #include using namespace std;int c[12][12];int a[12];void initc(){ memset(c, 0, sizeof(c)); c[0][0] = 1; for(int i=1; i<=10; i++){

2014-07-17 09:39:05 363

转载 POJ 2718 Smallest Difference

DFS嵌套DFS//156K 47MS#include #include #include #include #include //不加此头文件min和abs在一起会出现编译错using namespace std;const int inf = 0x7fffffff;int num[20];bool usea[20], useb[20];int cnt, cnta,

2014-07-16 20:17:02 365

原创 POJ 3669 Meteor Shower BFS

//624K 63MS#include #include #include #include #include using namespace std;struct node{ int x, y, t;};const int INF = 1e9 + 7;const int dx[4] = {1, 0, -1, 0};const int dy[4] = {0, 1,

2014-07-16 16:08:03 458

原创 POJ 3264(2) Balanced Lineup

这次不用区间扩展了。#include #include #include #include using namespace std;#define lson(x) ((x)<<1)#define rson(x) ((x)<<1 | 1)const int MAXN = 50000;const int INF = INT_MAX;int dat1[MAXN<<2], dat2

2014-07-15 17:08:05 321

原创 POJ 3468 A Simple Problem with Integers 线段树成段更新+区间查询

这次不用区间扩展了,那样写会

2014-07-15 16:52:41 393

原创 POJ 3264 Balanced Lineup 线段树的构建+区间查询

第一次写线段树,能写出来感觉很开心。。。

2014-07-14 15:53:55 355

原创 2014.7.14 CodeForces C题 字符串上的动态规划

题目大意是给你一个序列,让你最多改动一个点,求它的最长

2014-07-14 12:03:34 455

原创 线段树单点更新和区间查询

这是最基础的一类线段树问题。区间采用左闭右开

2014-07-13 10:41:58 387

原创 POJ 3276(第二篇)开关问题

之前写了一篇,是用mod 2实现将int类型

2014-07-12 16:30:27 459

原创 POJ 3276 Face The Right Way 开关问题

反转问题,WA了无数次了。。技巧是

2014-07-12 12:37:34 445

原创 POJ 2100 Graveyard Design

Time Limit: 10000MS Memory Limit: 64000KTotal Submissions: 4589 Accepted: 980Case Time Limit: 2000MS

2014-07-11 16:54:54 428

原创 POJ 2739 Sum of Consecutive Prime Numbers 素数打表+尺取法

http://poj.org/problem?id=2739普通的查

2014-07-11 11:17:31 397

原创 POJ 2566 Bound Found

http://poj.org/problem?id=2566这题参考了大健健

2014-07-10 17:44:00 436

原创 POJ 3685 Matrix 二维的二分

Time Limit: 6000MS Memory Limit: 65536KTotal Submissions: 4545 Accepted: 1143DescriptionGiven a N × N matrix A, whose element in the i-th row and j-th column Aij is an number that equals i2

2014-07-09 17:52:13 660

原创 POJ 3579 Median 查找中间值 二分

http://poj.org/problem?id=3579这个题求的是一列数所有相互之间差值的序列的最中间的值是多少。看到数据可以看到用普通的n^2方法必定超时。

2014-07-08 00:04:44 4008 1

原创 扩展欧几里德算法

之前写过的文章,现在粘过来

2014-07-07 16:17:02 511

转载 POJ 1061 青蛙的约会

公青蛙一开始在x位置,母青蛙在y位置。公青蛙每次跳m米,母青蛙每次跳n米,并且都是向右跳的。地球经线长度是L,然后地球是圆的,也就是说,跳到L、L+1、L+2……其实就是跳到0、1、2。 公青蛙想追母青蛙,问多少次后它们能跳到一起。如果它们永远不能相遇,就输出Impossible(好可怜啊!)很明显嘛,就是求一个k,使x + k*m ≡ y + k*n (mod L) 嘛,木有错吧?至少我

2014-07-07 16:13:27 339

原创 POJ 3111 K Best 最大化平均值

http://poj.org/problem?id=3111这题需要输出

2014-07-01 12:26:35 453

软件设计模式之装饰模式讲解

软件设计模式之装饰模式讲解ppt,可用于教学课件。

2015-05-15

基于C#的商店销售管理系统

基于C#的商店销售管理系统,用Winform的方式实现。

2015-05-01

Windows程序设计-贪吃蛇

贪吃蛇程序,通过键盘控制蛇的移动,可以暂停/继续,同时计分。

2015-04-28

平面导航网络

室内导航系统:基于房间的路径规划,输出最短路径。

2015-04-22

空空如也

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

TA关注的人

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