自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Kewowlo

这游戏不好玩

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

原创 基础图论算法导引

ACM中常用图论算法1. 拓扑排序 ->  拓扑排序的原理及其实现2. 最短路径算法 -> 最短路算法总结 差分约束系统 -> 差分约束 前k短路 -> 前K短路径问题3. 最小生成树问题扩展 -> 最​小​生​成​树​问​题​的​拓​展  最优比率生成树 -> 最优比率生成树 最小k度限制生成树 -> IOI2004国家集训队论文,由汪汀所著(网盘

2014-08-18 19:14:34 1522 2

原创 【DP】UVA 111 History Grading

输入的序列是表示 ai的位置上值为 i

2014-08-31 20:38:14 706

原创 【几何】HDU 1007 Quoit Design 最近点对

模板#include#include#include#include#include#include#include#includeusing namespace std;#include#include#include#include#include#includestruct Q{ double x, y;} q[100001], sl[10],

2014-08-28 18:25:28 692

原创 【字典树】POJ 2418 Hardwood Species

嘀嘀嘀有人知道 重载的时候 加了 sz=1;就一直CE怎么破???如果有人看到能教教我吗??我还不会c++弱菊不胜感谢!Orz#include#include#include#include#include#include#include#includeusing namespace std;#include#include#include#include#inc

2014-08-28 15:35:53 903

原创 Codeforces 461A Appleman and Toastman

思路需要#include#include#include#include#include#include#include#include#includeusing namespace std;#include#include#include#include#include#includeconst int INF = 0x3f3f3f3f;__int64 s[

2014-08-27 13:45:43 792

原创 【字典树】HDU 1247 Hat’s Words

题意:给你多个单词 输出能由另外两个单词组成的单词

2014-08-26 15:56:31 699

原创 【瞎搞】HDU 1422 重温世界杯

给你生活费和花费,看你最多活到几个城市。。

2014-08-25 17:28:53 798

原创 【最小割】HDU 4971 A simple brute force problem.

说是最大权闭合图....比赛时没敢写....题意一共有n个任务,m个技术完成一个任务可盈利一些钱,学习一个技术要花费钱完成某个任务前需要先学习某几个技术但是可能在学习一个任务前需要学习另几个任务求最多能赚多少钱咯先将缩点将需要一起学掉的技术缩成一个点建s--任务 权值为该任务盈利多少钱建技术(缩点后)-t 权值为学习这技术的花费(总)任务-技术

2014-08-21 22:30:26 1245

原创 【组合】HDU 3908 Triple

题意:在n个数中选出三个数满足下列

2014-08-20 18:47:06 709

原创 【线段树】HDU 3397 Sequence operation 区间合并

操作Change operations:0 a b change all characters into '0's in [a , b]1 a b change all characters into '1's in [a , b]2 a b change all '0's into '1's and change all '1's into '0's in [a, b]Out

2014-08-20 10:50:58 992

原创 【瞎搞】HDU 4961 Boring Sum

题意:所谓的b[i]是在a[i]的左边的倍数的值

2014-08-20 09:36:32 703

原创 【瞎搞】HDU 4968 Improving the GPA

枚举一种GPA有多少个总分1加上该GPA的最小分数总分2加上该GPA的最大分数若总分1则可以在枚举的状态达到目标分数#include #include #include #include #include using namespace std;#define IN freopen ("in.txt" , "r" , stdin);#define OUT

2014-08-19 19:50:20 917

原创 【线段树】HDU 3308 LCIS

嘀嘀嘀两种操作:#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #include #define IN freopen ("in.txt"

2014-08-18 18:45:08 741

原创 【线段树】POJ 3667 Hotel 区间合并

水题好像来的晚了一些sum表示

2014-08-18 14:43:55 719

原创 【树状数组】CF 459D Pashmak and Parmida's problem

ddd#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #include #define IN freopen ("in.txt" , "r" , stdin

2014-08-18 10:24:27 794

原创 【最小割】HDU 3251 Being a Hero

题意:一个国王封给Hero一个

2014-08-18 10:03:50 640

原创 【瞎搞】HDU 3257 Hello World!

题目只说了输入15进制的数

2014-08-17 18:27:03 658

原创 【数论】CF 385C Bear and Prime Numbers

地址:点击打开链接预处理出10^7次内的素数

2014-08-17 09:46:55 804

原创 【几何】HDU 3124 Moonmist 最近圆对

算给你的n个圆中最近的距离(无圆相交)

2014-08-16 22:32:58 998 2

原创 【DP】HDU 3127 WHUgirls 完全背包

dp[i][j]   i表示长 j表示宽

2014-08-16 21:15:55 725

原创 【DP】POJ 1252 完全背包

来回dp各一次。。

2014-08-15 21:55:09 709

原创 【并查集+拓扑排序】HDU1811 Rank of Tetris

若 a与b的关系为等号则关系已经确定,二则可以看成

2014-08-15 15:36:51 651

原创 【数论】HDU 4952 Number Transformation

x2*(i+1)>=x1*i;->x2=x1*i/(i+1);不断qi

2014-08-14 21:57:10 572

原创 【凸包】HDU 4946 Area of Mushroom

注意:1.重合的点2.速度为0的点#include #include #include #include #include #include #include #include #include using namespace std;#include #include #include typedef long long LL;#define lson l

2014-08-14 20:08:06 711

原创 【最小生成树变形】HDU 3367

题意:求最大的边权值的和使得

2014-08-14 11:00:29 696

原创 【最大流】POJ 1145 PIGS

合并点 合并边 亲仔细思考哦

2014-08-13 14:35:48 566

原创 【瞎搞】HDU4940 Destroy Transportation system

貌似题目错了。。。。巨巨men

2014-08-13 12:08:39 659

原创 【二分匹配】ZOJ 1654 Place the Robots

看论文时撸过。。。这类型应该suan

2014-08-12 10:49:27 840

原创 【贪心】HDU 4932 Miaomiao's Geometry

从大到排序两点的差和两点差的一半

2014-08-11 15:50:28 708

原创 【划分树】 POJ 2104 HDU 2665 K-th Number 裸题

了解。。。。

2014-08-11 13:42:39 646

原创 【划分树+二分】HDU 4417 Super Mario

第一次 耍划分树。。。模板是找第k小的

2014-08-10 18:25:44 930

原创 【最小割】HDU 3987 Harry Potter and the Forbidden Forest

得到的最小割得到sum sum/

2014-08-09 22:38:48 692

原创 【最大流】HDU 4292 Food

s-食物-人-人-饮料-t#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #include typedef long long LL;const int M

2014-08-09 19:40:22 654

原创 【最小割】HDU 4289 Control

把一个点拆成两个点

2014-08-09 19:36:25 682

原创 HDU 1599 floyd 最小环

最小环证明:一个环中的最大结点为k(编号最大),与他相连的两个点为i,j,这个环的最短长度为g[i][k]+g[k][j]+i到j的路径中,所有结点编号都小于k的最短路径长度根据floyd的原理,在最外层循环做了k-1次之后,dist[i][j]则代表了i到j的路径中,所有结点编号都小于k的最短路径综上所述,该算法一定能找到图中最小环

2014-08-06 19:16:57 681

原创 HDU4920 Matrix multiplication 矩阵

不要问窝 为什么过了> <窝也不造为什么就过了 说是%3变成稀疏矩阵 但是随便YY个案例都会超时。。。看来数据是随机的诶

2014-08-05 19:46:11 784

原创 HDU 3466 Proud Merchants 条件限制01背包

比如A:p1 q1, B:p2 q2, 然后,假设单独买A或者B的话,都是可以买到的。 这时,若先买A,则你至少需要p1+q2的钱; 若先买B,则至少需要p2+q1的钱。那肯定是花最少的钱咯, 所以如果先买A再买B,那么p1+q2 就是q1-p1>q2-p2,也就是说qi-pi大的先买。#include #include #include #include

2014-08-04 21:43:56 672

原创 HDU 2639 Bone Collector II 背包k优解

其基本思想是将每个状态都表示成有序队列,将状态转移方程中的max/min转化成有序队列的合并。这里仍然以01背包为例讲解一下。首先看01背包求最优解的状态转移方程:f[i][v]=max{f[i-1][v],f[i-1][v-c[i]]+w[i]}。如果要求第K优解,那么状态f[i][v]就应该是一个大小为K的数组f[i][v][1..K]。其中f[i][v][k]表示前i个物品、背包大小为v

2014-08-04 20:35:35 564

原创 【DP】UVA 624 CD 记录路径

开一个数组p若dp[i-1][j]递归输出p#include #include #include #include #include #include #include #include #include#include using namespace std;#define MAXN 11111#include #include #define I

2014-08-04 10:35:48 846

原创 POJ 3119 Friends or Enemies?

先预处理得到各个编号的点的位置再判断 点在二元一次方程的上方还是下方#include #include #include #include #include #include #include #include #include#include using namespace std;#define MAXN 11111#include #include struct

2014-08-02 20:42:38 912

空空如也

空空如也

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

TA关注的人

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