
DP
文章平均质量分 87
x_ring
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
AVL树的种类
AVL树的种类 平衡二叉树(AVL树),是指左右子树高度差至多为1的二叉树,并且该树的左右两个子树也均为AVL树。 现在问题来了,给定AVL树的节点个数n,求有多少种形态的AVL树恰好有n个节点。Input一行,包含一个整数n。 (0 Output一行表示结果,由于结果巨大,输出它对1000000007取余数的结果。Sample Input10S原创 2017-04-08 20:10:33 · 558 阅读 · 0 评论 -
Aibohphobia
Aibohphobia BuggyD suffers from AIBOHPHOBIA - the fear of Palindromes. A palindrome is a string that reads the same forward and backward.To cure him of this fatal disease, doctors from a原创 2017-04-08 20:07:59 · 395 阅读 · 0 评论 -
Alphacode
Alphacode Alice and Bob need to send secret messages to each other and are discussing ways to encode their messages:Alice: “Let’s just use a very simple code: We’ll assign ‘A’ the code wor原创 2017-04-06 22:15:58 · 312 阅读 · 0 评论 -
Buying Apples!
Buying Apples! Harish went to a supermarket to buy exactly ‘k’ kilograms apples for his ‘n’ friends. The supermarket was really weird. The pricing of items was very different. He went to the A原创 2017-04-06 22:14:37 · 281 阅读 · 0 评论 -
回文串划分
回文串划分 有一个字符串S,求S最少可以被划分为多少个回文串。例如:abbaabaa,有多种划分方式。a|bb|aabaa - 3 个回文串a|bb|a|aba|a - 5 个回文串a|b|b|a|a|b|a|a - 8 个回文串其中第1种划分方式的划分数量最少。Input输入字符串S(S的长度Output输出最少的划分数原创 2017-04-06 17:03:32 · 301 阅读 · 0 评论 -
数组的最大代价
数组的最大代价 数组A包含N个元素A1, A2......AN。数组B包含N个元素B1, B2......BN。并且数组A中的每一个元素Ai,都满足1 (公式表示所有两个相邻元素的差的绝对值之和)给出数组B,计算可能的最大代价S。Input第1行:1个数N,表示数组的长度(1 Output输出最大代价S。Sample Input51原创 2017-04-06 16:56:14 · 186 阅读 · 0 评论 -
编辑距离
编辑距离 编辑距离,又称Levenshtein距离(也叫做Edit Distance),是指两个字串之间,由一个转成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一个字符,插入一个字符,删除一个字符。例如将kitten一字转成sitting:sitten (k->s)sittin (e->i)sitting (->g)所以kitten和s原创 2017-04-06 16:53:54 · 148 阅读 · 0 评论 -
zoj3160Couples
zoj3160CouplesIn the world ofknowledge, so many new words appear on the internet. A special one is"8g", a kind of special relationship between two persons. (If youwant to know more words, just turn原创 2017-04-04 19:41:20 · 189 阅读 · 0 评论