- 博客(49)
- 资源 (1)
- 收藏
- 关注
原创 取子集
#include #include #include using 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 933
原创 数位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 487
原创 codeforces 149d Coloring Brackets
Coloring Brackets time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Once Petya read a problem about a bracket sequence. H
2015-07-10 20:00:29 528
原创 poj 2955
Brackets Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3961 Accepted: 2085 Description We give the following inductive definition of a “regular brackets”
2015-07-10 19:52:05 593
原创 LightOJ 1422 Halloween Costumes (区间dp)
1422 - Halloween Costumes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Gappu has a very busy weekend ahead of him. Beca
2015-07-10 19:30:53 750
转载 树状数组
转自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 808
原创 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 1159 Palindrome
Palindrome Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 52716 Accepted: 18187 Description A palindrome is a symmetrical string, that is, a string read i
2014-08-13 08:28:57 562
原创 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 Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 34147 Accepted Submission(s): 11061 Problem Description In the m
2014-08-11 13:55:22 566 1
原创 poj 1330 Nearest Common Ancestors
Nearest Common Ancestors Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17879 Accepted: 9492 Description A rooted tree is a well-known data structure in c
2014-08-06 21:37:03 493
原创 poj 1094 Sorting It All Out(拓扑排序)
Sorting It All Out Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 27572 Accepted: 9546 Description An ascending sorted sequence of distinct values is one
2014-08-06 14:46:23 673
原创 hdu 1867 A + B for you again
A + B for you again Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4214 Accepted Submission(s): 1077 Problem Description Genera
2014-08-04 08:41:42 642
原创 hdu 1422 重温世界杯
重温世界杯 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4370 Accepted Submission(s): 1492 Problem Description 世界杯结束了,意大利人连本带利的收回了法
2014-08-01 07:41:17 784
原创 poj 1821 Fence(dp+单调队列优化)
Fence Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3485 Accepted: 1047 Description A team of k (1 <= K <= 100) workers should paint a fence which contai
2014-07-20 16:28:12 3155 2
原创 poj 1080 Human Gene Functions(dp)
Human Gene Functions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16748 Accepted: 9295 Description It is well known that a human gene can be considered
2014-06-10 23:41:06 734
原创 poj 1019 Number Sequence(dp+二分)
Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 33439 Accepted: 9559 Description A single positive integer i is given. Write a program to f
2014-06-10 10:47:15 670
原创 poj 1088 滑雪
滑雪 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 73837 Accepted: 27295 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等
2014-06-07 22:40:58 571
原创 poj 1050 To the Max
To the Max Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 39768 Accepted: 21017 Description Given a two-dimensional array of positive and negative integer
2014-06-05 16:48:18 545
原创 poj 1018Communication System
Communication System Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 22559 Accepted: 8037 Description We 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): 7927 Problem Description 给定K个整数的序列{ N1, N2
2014-05-22 20:36:45 503
原创 最长公共子序列,最大递增子序列,最长公共递增子序列
Common Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 21529 Accepted Submission(s): 9351 Problem Description A subs
2014-05-22 18:14:56 638
原创 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 907
原创 hdu 1424 Rescue
Rescue Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14408 Accepted Submission(s): 5225 Problem Description Angel was caught b
2014-05-05 23:28:03 853
原创 Codeforces Round #244 (Div. 2)a Police Recruits
A. Police Recruits time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The police department of your city has ju
2014-05-03 01:43:40 971
原创 hdu Calculator 3546
Calculator Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1398 Accepted Submission(s): 346 Problem Description Golden Adobe is
2014-04-28 18:53:29 813
原创 康托展开和逆康托展开
维基百http://zh.wikipedia.org/wiki/%E5%BA%B7%E6%89%98%E5%B1%95%E5%BC%80
2014-04-22 12:40:33 769
背包九讲()
2014-04-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人