自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

mousehao

不抛弃,不放弃!!

  • 博客(49)
  • 资源 (1)
  • 收藏
  • 关注

原创 取子集

#include#include#includeusing namespace std;void print(int n){ for(int i=0;(1<<i)<=n;i++) if(n&(1<<i)) cout<<1; else cout<<0; cout<<endl;}int main(){ i

2014-09-09 15:47:04 929

原创 kmp的简单理解

参考的是:http://www.matrix67.com/blog/archives/115kmp算法就是

2014-08-03 19:30:42 896 2

原创 数位dp专辑

1.题目链接:codeforces 55D【题意】一个数能被它每一位的数字整除(0除外)则为beautiful number ,问[l,r]之间有多少个这样的数【思路】考虑到每一位的数字只能是1,2,,9,最小公倍数为2520.            设数w=x*2520+y,每位数字的最小公倍数为mul,则w%mul=(x*2520+y)%mul=x*2520%mul+y%mul=y%mul

2015-07-17 18:02:21 484

原创 codeforces 149d Coloring Brackets

Coloring Bracketstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce Petya read a problem about a bracket sequence. H

2015-07-10 20:00:29 527

原创 poj 2955

BracketsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3961 Accepted: 2085DescriptionWe give the following inductive definition of a “regular brackets”

2015-07-10 19:52:05 592

原创 LightOJ 1422 Halloween Costumes (区间dp)

1422 - Halloween Costumes PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBGappu has a very busy weekend ahead of him. Beca

2015-07-10 19:30:53 749

转载 树状数组

转自http://hawstein.com/posts/binary-indexed-trees.html#findind树状数组(Binary Indexed Trees)November 15, 2012作者:Hawstein出处:http://hawstein.com/posts/binary-indexed-trees.html声明:本文采用以下协议进行

2014-08-21 08:59:31 807

原创 poj 2486 Apple Tree

题目:http://poj.org/problem?id=2486【题意】:给一棵树,每个节点上有一些苹果,根节点编号为1,从根节点开始走,一共走K步(一步走一条边),问最多能吃到多少苹果【思路】:dp~~  这个题的状态设置有多种方法,此题有一个特性,即:对于每一种走法,所走子树的顺序不影响最终的结果①dp[i][j][0/1],以i为根节点,最多可以走j步最后回到(即1)i点,最多

2014-08-20 14:32:09 581

原创 poj 1185 炮兵阵地

题目连接:http://poj.org/problem?id=1185

2014-08-18 15:46:21 582

原创 poj 3034 Whac-a-Mole(dp)

题目:http://poj.org/problem?id=3034

2014-08-15 16:39:27 631

原创 poj 1159 Palindrome

PalindromeTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 52716 Accepted: 18187DescriptionA palindrome is a symmetrical string, that is, a string read i

2014-08-13 08:28:57 561

原创 ac 自动机

/*ac自动机=kmp+trie与kmp的思想是一样的,不过实现起来就有相当多的细节问题了。1.建立字典树是必须的,ch[i][j],i是节点编号,j是儿子。每一个节点都隐含有MAX_SIZE个儿子的指针,0表示该儿子不存在,其他值表示她的位置2.算出失配边,对于ch[i][j]!=0的处理方法与kmp中是相同的。但对于ch[i][j]=0的处理有两种,①不处理,直

2014-08-11 20:41:54 519

原创 hdu 2222(Keywords Search) (AC自动机)

Keywords SearchTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34147    Accepted Submission(s): 11061Problem DescriptionIn the m

2014-08-11 13:55:22 565 1

原创 poj 1330 Nearest Common Ancestors

Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 17879 Accepted: 9492DescriptionA rooted tree is a well-known data structure in c

2014-08-06 21:37:03 492

原创 poj 1094 Sorting It All Out(拓扑排序)

Sorting It All OutTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27572 Accepted: 9546DescriptionAn ascending sorted sequence of distinct values is one

2014-08-06 14:46:23 672

原创 hdu 1867 A + B for you again

A + B for you againTime Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4214    Accepted Submission(s): 1077Problem DescriptionGenera

2014-08-04 08:41:42 640

原创 hdu 1422 重温世界杯

重温世界杯Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4370    Accepted Submission(s): 1492Problem Description世界杯结束了,意大利人连本带利的收回了法

2014-08-01 07:41:17 781

原创 poj 1821 Fence(dp+单调队列优化)

FenceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3485 Accepted: 1047DescriptionA team of k (1 <= K <= 100) workers should paint a fence which contai

2014-07-20 16:28:12 3152 2

原创 poj 1080 Human Gene Functions(dp)

Human Gene FunctionsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16748 Accepted: 9295DescriptionIt is well known that a human gene can be considered

2014-06-10 23:41:06 733

原创 poj 1019 Number Sequence(dp+二分)

Number SequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 33439 Accepted: 9559DescriptionA single positive integer i is given. Write a program to f

2014-06-10 10:47:15 669

原创 poj 1088 滑雪

滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 73837 Accepted: 27295DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等

2014-06-07 22:40:58 570

原创 poj 1050 To the Max

To the MaxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 39768 Accepted: 21017DescriptionGiven a two-dimensional array of positive and negative integer

2014-06-05 16:48:18 544

原创 poj 1018Communication System

Communication SystemTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 22559 Accepted: 8037DescriptionWe have received an order from Pizoor Communications

2014-06-05 15:16:18 714

原创 最大连续子序列

最大连续子序列Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17920    Accepted Submission(s): 7927Problem Description给定K个整数的序列{ N1, N2

2014-05-22 20:36:45 502

原创 最长公共子序列,最大递增子序列,最长公共递增子序列

Common SubsequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21529    Accepted Submission(s): 9351Problem DescriptionA subs

2014-05-22 18:14:56 637

原创 用 梯形法,矩形法,辛普生法,变步长梯形法,求积分

用 梯形法,矩形法,辛普生法,变步长梯形法,求积分

2014-05-22 16:36:21 5142

原创 Codeforces Round #247 (Div. 2)a.Black Square,b.Shower Line,c.k-Tree前三题

题目链接a.Black Squarehttp://codeforces.com/contest/431/problem/A

2014-05-22 13:44:42 905

原创 用邻接表实现spfa

1    2    3

2014-05-07 21:12:12 1300 2

原创 hdu 2717 (poj 3278)Catch That Cow

水的bfs,坑爹的是vis没初始化,poj上过了

2014-05-06 18:00:05 820

原创 hdu 1424 Rescue

RescueTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14408    Accepted Submission(s): 5225Problem DescriptionAngel was caught b

2014-05-05 23:28:03 852

原创 Codeforces Round #244 (Div. 2)E. Police Patrol

一开始以近乎枚举defangshi

2014-05-03 10:40:35 2550

原创 Codeforces Round #244 (Div. 2)B Prison Transfer

题意:找连续的c个数,最大不超过的

2014-05-03 01:54:01 769

原创 Codeforces Round #244 (Div. 2)a Police Recruits

A. Police Recruitstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe police department of your city has ju

2014-05-03 01:43:40 967

原创 hdu 3183 A Magic Lamp

题意:一串数字,删去m个数字,输出

2014-05-01 01:17:23 636

原创 hdu Calculator 3546

CalculatorTime Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1398    Accepted Submission(s): 346Problem DescriptionGolden Adobe is

2014-04-28 18:53:29 811

原创 背包问题(一)

详细的参见背包九讲

2014-04-26 23:21:29 1016 3

原创 vector的用法

vector的使用在代码中shio

2014-04-24 11:40:58 534

原创 poj 1328 Radar Installation

做的poj第一个题,

2014-04-22 22:46:42 738 2

原创 康托展开和逆康托展开

维基百http://zh.wikipedia.org/wiki/%E5%BA%B7%E6%89%98%E5%B1%95%E5%BC%80

2014-04-22 12:40:33 767

原创 hdu2923 Einbahnstrasse

题意:n个城市,cliang

2014-04-19 11:26:12 652

背包九讲()

流传甚广的背包九讲 背包问题九讲 目录 第一讲 01背包问题 第二讲 完全背包问题 第三讲 多重背包问题 第四讲 混合三种背包问题 第五讲 二维费用的背包问题 第六讲 分组的背包问题 第七讲 有依赖的背包问题 第八讲 泛化物品 第九讲 背包问题问法的变化 附录一:USACO中的背包问题 附录二:背包问题的搜索解法

2014-04-26

空空如也

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

TA关注的人

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