自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

willinglive

///////////////////////////////////AFO★★★★★★★★★★★★★

  • 博客(353)
  • 资源 (2)
  • 收藏
  • 关注

原创 【旋转卡壳】【bzoj 1069】: [SCOI2007]最大土地面积

http://www.lydsy.com/JudgeOnline/problem.php?id=1069枚举对角线就可以啦~//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**********************

2014-12-16 21:48:57 515

原创 【树链剖分】【bzoj 1146】: [CTSC2008]网络管理Network

http://www.lydsy.com/JudgeOnline/problem.php?id=1146以前看来是一道神题,今天终于A了二分+树链剖分+树套树 4个log 2333333由于写得非常模块化,所以代码写起来有点长,但是写完了只改了两个地方!!!思路写得很清晰,以后写主席树我貌似很落后诶、、、//#define _TEST _TEST#

2014-12-16 20:30:32 658

原创 【混合图欧拉路判定】【poj 1637】Sightseeing tour

http://poj.org/problem?id=1637题解:http://www.cnblogs.com/kuangbin/p/3537525.html//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/***

2014-12-16 10:09:13 506

原创 【最小割】【hdu 4307】Matrix

http://acm.hdu.edu.cn/showproblem.php?pid=4307我曾经一直以为bfs比dfs快,知道我今天放弃这个想法了,怎么也赶不上dfs。。。。以后还是用bfs+dfs吧。。。。。第4次换模板。。。。。。hhhhh。我真好笑公式我写出来了,照着公式建图就可以了//#define _TEST _TEST#inclu

2014-12-15 15:08:29 448

原创 【一堆网络流】

最小割HDU 3452:根节点连S,叶子节点连T,求最小割HDU 3987:首先想到费用流,但是费用都为1,所以可以通过改变边权来实现

2014-12-15 08:02:33 457

原创 【最小割】【poj 3469】 Language

http://poj.org/problem?id=3469看到有个人也用bfs+bfs,于是我把自己的模板和他的综合了一下,快了一点,但还是比他慢得多,不止为何。。。。。。。。。。。。//#define _TEST _TEST#include #include #include #include #include #include using namespa

2014-12-13 17:52:29 393

原创 【树形DP】【多叉转二叉】【poj 1947】Rebuilding Roads

http://poj.org/problem?id=1947对多叉转二叉不是很熟悉,参考了下别人的代码,写得很好//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/****************************

2014-12-12 20:36:33 505

原创 【树形DP】【HDU 4276】The Ghost Blows Light

http://acm.hdu.edu.cn/showproblem.php?pid=4276给定一颗带点权边权的树,求一条1-n的可重复经过的路径使得经过的总边权在时间范围内,且总点权最大(点权只能取一次)先bfs1-n的路径,时间减掉,点权边权设为0再从n点,DP一次,算从n点出发的总点权最大蒟蒻懒得写代码了

2014-12-12 20:12:42 514

原创 【树形DP】【poj 2057】The Lost House

http://poj.org/problem?id=2057这道题很久以前就看到过,一直没看懂题,所以就一直放着先学好英语,然后就可以做了这篇论文里讲得很清楚http://wenku.baidu.com/link?url=t2T0VjAbXPHk1tEM0o8f8orqAbDT34Xs0mAGDq4fxylFsla1RENJhrWgPmq6P7-DkhenpY9ASThFD

2014-12-12 15:10:47 470

原创 【矩阵模板】【hdu 1575】Tr A

http://acm.hdu.edu.cn/showproblem.php?pid=1575裸矩阵快速幂,从来没有写过模板,每次都是乱搞,写得乱七八糟的,以后统一写struct//#define _TEST _TEST#include #include #include #include #include #include using namespace st

2014-12-12 10:55:38 427

原创 【后缀数组】【URAL 1297】Palindrome

http://acm.timus.ru/problem.aspx?space=1&num=1297基本应用——最长回文子串不想写了,说下思路其实这道题就是暴力+优化枚举中间点,求两边的LCP于是需要RMQ预处理没了

2014-12-12 10:08:30 453

原创 【后缀数组】【spoj 220】Relevant Phrases of Annihilation

http://www.spoj.com/problems/PHRASES/基本应用——每个字符串至少出现两次且不重复的最长子串memset的mmin[]和mmax开大了简直是作死,狂T不止。。。//#define _TEST _TEST#include #include #include #include #include #include

2014-12-12 10:02:02 484

原创 【后缀数组】【poj 2406】Power Strings

http://poj.org/problem?id=2406基本应用——连续重复子串首先这道题KMP做法很显然,不再赘述讲讲后缀数组的做法吧枚举长度L,再看LCP(1,L+1)是否等于n-LRMQ预处理一下就可以啦看起来很简单的样纸,懒得写代码了

2014-12-11 21:51:29 530

原创 【后缀数组】【poj 3693】Maximum repetition substring

http://poj.org/problem?id=3693基本应用——重复次数最多的连续重复字串开始自己以为所有这样的子串都满足在sa[]中相邻,写了个程序发现我错了例如babb,sa[]=3 1 4 2,不满足于是参观题解,要用RMQ,慢慢研究吧,先写到这

2014-12-11 21:09:40 471

原创 【后缀数组】【poj 3294】Life Forms

http://poj.org/problem?id=3294hehe被虐基本应用——不小于k个字符串的最长子串//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/***************************

2014-12-11 19:59:17 503

原创 【最小路径覆盖】Assassin`s Creed (II)

DescriptionEzio needs to kill N targets located in N different cities. The cities are connected by some one way roads. As time is short, Ezio can send a massage along with the map to the assassi

2014-12-11 12:22:57 613

原创 【最大独立集】Prime Independence

Prime IndependenceDescriptionA set of integers is called prime independent if none of its member is a prime multiple of another member. An integer ais said to be a prime multiple of b if

2014-12-11 10:39:56 742

原创 【一堆二分图】

HDU 1054:无向图最小顶点覆盖,maxmatch/2

2014-12-10 09:40:51 829

原创 【数位DP】【bzoj 1799】: [Ahoi2009]self 同类分布

http://www.lydsy.com/JudgeOnline/problem.php?id=1799于是光荣这题。。。。因为只有一个问,我乱搞压了下内存,过了不知正解如何设计状态。?//#define _TEST _TEST#include #include #include #include #incl

2014-12-10 08:42:18 595

原创 【数位DP】【hdu 4352】XHXJ's LIS

http://acm.hdu.edu.cn/showproblem.php?pid=4352数位DP套状压DP再套LIS整个人都DP啦//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/*************

2014-12-09 21:37:40 613

原创 【数位DP】【hdu 3943】K-th Nya Number

http://acm.hdu.edu.cn/showproblem.php?pid=3943被虐哈哈哈该练递推了//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**************************

2014-12-09 17:32:57 458

原创 【一些DP】

HDU 3709:Balanced numberdfsdp[pos][k][dif]k:平衡点HDU 4507:恨7不成妻dfsdp[pos][sum][digitsum]dp开一个struct平方和推公式

2014-12-09 14:46:34 524

原创 【数位DP】【SGU 258】. Almost Lucky Numbers

http://acm.sgu.ru/problem.php?contest=0&problem=258还是不好想//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/****************************

2014-12-09 12:21:06 491

原创 【数位DP】【poj 3252】Round Numbers

http://poj.org/problem?id=3252组合计数?和数位DP差不多啦~//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/*************************************

2014-12-09 10:55:54 401

原创 【CodeForces 417D】【Cunning Gena】

http://codeforces.com/problemset/problem/417/D看来最近智商真的是出了大问题了,英语也读不懂了、//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**************

2014-12-08 09:48:37 440

原创 【bzoj 1076】: [SCOI2008]奖励关

http://www.lydsy.com/JudgeOnline/problem.php?id=1076先水一发不知道末状态的期望。所以不能顺推开始SB写的顺推,发现不知道答案如何计算参观了下题解。。。。。我太弱。。。//#define _TEST _TEST#include #include #include #include #incl

2014-12-08 08:47:50 544

原创 【高斯消元模板】【bzoj 1013】: [JSOI2008]球形空间产生器sphere

http://www.lydsy.com/JudgeOnline/problem.php?id=1013再换一个模板= =||//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/*********************

2014-12-07 20:19:54 486

原创 【高斯消元】【poj 1830】开关问题

http://poj.org/problem?id=1222最近智商出了点问题,被这道题卡了,不和上一道一样么?//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**************************

2014-12-06 15:27:32 531

原创 【高斯消元】【poj 2065】SETI

http://poj.org/problem?id=2065还是没有明白guass()怎么工作的,反正照着模板打就A了。。。//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**********************

2014-12-06 11:21:36 515

原创 【莫比乌斯函数】【SPOJ 4491】PGCD

http://www.spoj.com/problems/PGCD/这篇讲得很好了http://www.cnblogs.com/kuangbin/p/3378531.html亲测手写min和改了几个int快了5s//#define _TEST _TEST#include #include #include #include #inclu

2014-12-05 10:42:41 548

原创 【莫比乌斯函数】【ZOJ 3435】Ideal Puzzle Bobble

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3435这题略坑SDOI仪仗队的三维扩展因为给了a,b,c三个数,所以肯定用莫比乌斯反演这题200组数据,必须用迭代分段处理如果a,b,c可以为1的话,还要考虑一种特殊情况(我的代码里有,但a,b,c>=2)还有a,b,c必须开long

2014-12-04 20:55:42 957

原创 【贪心】【poj 4028】GCD Guessing Game

http://poj.org/problem?id=4028现在有一个数x,1 ≤ x≤ n,告诉你n,每次你可以猜一个数y,如果x==y则结束,否则返回gcd(x,y),问最少只要几次就可以保证猜出答案。贪心。题解见http://blog.csdn.net/keshuai19940722/article/details/38352765我只是实现了一下代码

2014-12-04 17:51:09 621

原创 【后缀数组】【poj 1743】Musical Theme

http://poj.org/problem?id=1743基本应用——不可重叠最长重复子串//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**************************************

2014-12-03 22:16:43 418

原创 【后缀数组】【poj 3261】Milk Patterns

http://poj.org/problem?id=3261刚被拉去上了两节晚自(shui)习(jiao),终于逃出来了裸题现在觉得只要把DA算法打对了,基本上裸题就没什么问题了这次感觉熟练多了,1A//#define _TEST _TEST#include #include #include #include #include #inclu

2014-12-03 21:31:42 406

原创 【后缀数组】【spoj 694】Distinct Substrings

啊哈哈哈被后缀数组虐了一下午,写了三道题有两道没调处来,只有一道AC了求一个字符串的不重复子串的个数。//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/*******************************

2014-12-03 17:09:16 437

原创 【Trie模板更新】【hdu 1251】

http://acm.hdu.edu.cn/showproblem.php?pid=1251改了一下root的部分8000多人诶,居然跑了rank3!//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/*******

2014-12-03 13:53:52 416

原创 【后缀数组】【bzoj 1031】: [JSOI2007]字符加密Cipher

http://www.lydsy.com/JudgeOnline/problem.php?id=1031我太落后了,必须赶进度了找了好几个模板,最终决定背这个虽然我没懂,但看起来实现得非常清晰,模块化交换数组的时候慢了点,hzwer的代码开了两个,交换的时候只交换了指针,也牺牲了点空间//#define _TEST _TEST#include #in

2014-12-03 10:59:52 497

原创 【hust 1328】 - String

http://acm.hust.edu.cn/problem/show/1328我太弱了,这个破next我理解了那么久,今天发现全不会了//#define _TEST _TEST#include #include #include #include #include #include using namespace std;/**************

2014-12-02 21:34:21 522

原创 KMP算法对next理解题集

hdu3336 Count the string转载:http://blog.csdn.net/shahdza/article/details/6303578Count the stringTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

2014-12-02 20:38:18 1065

原创 【可持久化线段树】【hdu 4348】To the moon

http://acm.hdu.edu.cn/showproblem.php?pid=4348可持久化线段树区间更新注意不能可持久化lazy标记,所以区间加操作需要消掉lazy看到有人给出了一种很好的做法,学习了下注意long long有两个地方的乘号没有转换,一直wa//#define _TEST _TEST#include #include #inclu

2014-12-02 19:47:00 617

迷你C++ 6.0版本

非常迷你的Visual C++, 6.0版本 一分钟安装

2013-02-19

分享100个漂亮的图标图标

分享100个漂亮的图标图标,写程序很有用哦!

2013-02-19

空空如也

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

TA关注的人

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