人生列车

follow on!success!

导航

2014年7月28日 #

Codeforces 237C

摘要: 题目:DescriptionYou've decided to carry out a survey in the theory of prime numbers. Let us remind you that a prime number is a positive integer that ha... 阅读全文

posted @ 2014-07-28 17:27 tianxia2s 阅读(196) 评论(2) 推荐(0) 编辑

状态压缩DP

摘要: status{x1,x2,x3,x4,………xn-1,xn}表示每只鱼是否还活着的状态 xi=1表示第i条鱼还活着 xi=0表示第i条鱼已经被吃掉了 dp(status)表示形成status这种状态的概率 那么刚开始的时候(第一天),所有的鱼都活着。 那么dp({1,1,1,1….,1,1,1})=... 阅读全文

posted @ 2014-07-28 17:00 tianxia2s 阅读(164) 评论(0) 推荐(0) 编辑

KMP算法类习题——字符串匹配

摘要: DescriptionFor each prefix with length P of a given string S,ifS[i]=S[i+P] for i in [0..SIZE(S)-p-1],then the prefix is a “period” of S. We want to al... 阅读全文

posted @ 2014-07-28 13:13 tianxia2s 阅读(332) 评论(0) 推荐(0) 编辑