- 博客(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
988
原创 数位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
546
原创 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
606
原创 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
662
原创 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
814
转载 树状数组
转自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
860
原创 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
638
原创 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
601
原创 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
575
原创 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
628
原创 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
557
原创 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
730
原创 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
690
原创 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
829
原创 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
3254
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
789
原创 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
741
原创 poj 1088 滑雪
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 73837 Accepted: 27295DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等
2014-06-07 22:40:58
604
原创 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
591
原创 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
748
原创 最大连续子序列
最大连续子序列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
533
原创 最长公共子序列,最大递增子序列,最长公共递增子序列
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
693
原创 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
977
原创 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
904
原创 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
1066
原创 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
848
原创 康托展开和逆康托展开
维基百http://zh.wikipedia.org/wiki/%E5%BA%B7%E6%89%98%E5%B1%95%E5%BC%80
2014-04-22 12:40:33
805
背包九讲()
2014-04-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人