上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页

2011年10月27日

poj 2888 Magic Bracelet

摘要: Magic BraceletTime Limit: 2000MSMemory Limit: 131072KTotal Submissions: 2537Accepted: 844DescriptionGinny’s birthday is coming soon. Harry Potter is preparing a birthday present for his new girlfriend. The present is a magic bracelet which consists of n magic beads. The are m kinds of different magi 阅读全文

posted @ 2011-10-27 20:42 Goal 阅读(416) 评论(0) 推荐(0) 编辑

2011年10月26日

网址

摘要: http://acmicpc.info/archives/505 阅读全文

posted @ 2011-10-26 21:29 Goal 阅读(190) 评论(0) 推荐(0) 编辑

poj Color

摘要: ColorTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 4295Accepted: 1437DescriptionBeads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the necklace can be produced. You should know that the neck 阅读全文

posted @ 2011-10-26 19:07 Goal 阅读(187) 评论(0) 推荐(0) 编辑

Catalan数

摘要: Catalan数 中文:卡特兰数 原理: 令h(1)=1,h(0)=1,catalan数满足递归式: h(n)= h(1)*h(n-1) + h(2)*h(n-2) + ... + h(n-1)h(1) (其中n>=2) 另类递归式: h(n)=((4*n-2)/(n+1))*h(n-1); 该递推关系的解为: h(n)=C(2n,n)/(n+1) (n=1,2,3,...) 我并不关心其解是怎么求出来的,我只想知道怎么用catalan数分析问题。 我总结了一下,最典型的四类应用:(实质上却都一样,无非是递归等式的应用,就看你能不能分解问题写出递归式了) 1.括号化问题。... 阅读全文

posted @ 2011-10-26 15:48 Goal 阅读(186) 评论(0) 推荐(0) 编辑

2011年10月25日

深搜学习

摘要: Epai={pai[v],v:v-V&&pai[v]!=NIL} Epai为树边;深搜对每个顶点都加了一个时间戳,每个顶点有两个时间戳,当顶点v第一次被发现(被标记成灰色)时,记下第一个时间戳的d[v],当结束检查v的邻接表(黑色),记下第二个时戳f[v],d[v]<f[v],顶点v在d[v]之前是白色,在d[v]和f[v]之间为灰色,以后就变成黑色了;DFS(G)for each vertex u-v[G] do color-white pai[v]=NIL time=0 for each u-v[G] do if color[u]=white dfs(u)dfs_vi 阅读全文

posted @ 2011-10-25 20:37 Goal 阅读(184) 评论(0) 推荐(0) 编辑

poj Anti-prime Sequences

摘要: Anti-prime SequencesTime Limit: 3000MSMemory Limit: 30000KTotal Submissions: 1820Accepted: 844DescriptionGiven a sequence of consecutive integers n,n+1,n+2,...,m, an anti-prime sequence is a rearrangement of these integers so that each adjacent pair of integers sums to a composite (non-prime) number 阅读全文

posted @ 2011-10-25 20:17 Goal 阅读(329) 评论(0) 推荐(0) 编辑

2011年10月24日

poj Prime Land

摘要: Prime LandTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1630Accepted: 745DescriptionEverybody in the Prime Land is using a prime base number system. In this system, each positive integer x is represented as follows: Let {pi}i=0,1,2,... denote the increasing sequence of all prime numbers. 阅读全文

posted @ 2011-10-24 21:03 Goal 阅读(169) 评论(0) 推荐(0) 编辑

2011年10月23日

Miller_Rabbin测试

摘要: 最近在学习数论:贴一下Miller_Rabbin测试;代码:#include<stdio.h>#include<stdlib.h>#include<time.h>#define maxTest 100__int64 Random(__int64 n){ return (__int64)((double)rand()/RAND_MAX*n+0.5);}__int64 Modular_Exp(__int64 a, __int64 b, __int64 n) // a^b mod n { __int64 ans; if(b == 0) return 1; if(b 阅读全文

posted @ 2011-10-23 20:32 Goal 阅读(327) 评论(0) 推荐(0) 编辑

2011年10月22日

hdu Computer Transformation

摘要: 直播入口——欢迎围观ACM/ICPC北京现场赛~ Computer TransformationTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2921Accepted Submission(s): 1111Problem DescriptionA sequence consisting of one digit, the number 1 is initially written into a computer. At each succes 阅读全文

posted @ 2011-10-22 20:01 Goal 阅读(271) 评论(0) 推荐(0) 编辑

hdu Ignatius and the Princess II

摘要: 直播入口——欢迎围观ACM/ICPC北京现场赛~ Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1873Accepted Submission(s): 1129Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is a 阅读全文

posted @ 2011-10-22 18:17 Goal 阅读(324) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页

导航