摘要: Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is for 阅读全文
posted @ 2017-08-05 17:42 爱简单的Paul 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 求字典序在s1和s2之间的,长度在len1到len2的字符串的个数,结果mod 1000007。 输入 ab ce 1 2 输出 56 # --*-- coding:utf-8 --*-- import sys # 思路: 想象成26进制的数,有点动态规划的思想,res[]存放状态数,后一个要依赖于 阅读全文
posted @ 2017-08-05 10:39 爱简单的Paul 阅读(664) 评论(0) 推荐(0) 编辑