ACM解题报告
文章平均质量分 84
Skywalker11111
这个作者很懒,什么都没留下…
展开
-
POJ: 1011 Sticks
POJ: 1011问题描述乔治拿来一组等长的木棒,将它们随机地裁断,使得每一节木棒的长度都不超过 50 个长度单位。然后他又想把这些木棒恢复到裁截前的状态,但忘记了初始时有多少木棒以及木棒的初始长度。请你设计一个程序,帮助乔治计算木棒的可能最小长度。每一节木棒的长度都用大于零的整数表示。输入数据由多个案例组成,每个案例包括两行。第一行是一个不超过 64 的整数,表示裁截...原创 2011-04-24 10:15:51 · 162 阅读 · 0 评论 -
Jungle Roads
tween villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expensive to maintain. The Council of Elders must choose to stop maintaining some roads. The map above on the left shows all the roads in u原创 2011-05-01 10:24:57 · 115 阅读 · 0 评论 -
POJ Frogger--Dijkstra算法
原创 2011-05-04 20:01:41 · 130 阅读 · 0 评论 -
NOJ 1848--二叉树
前序遍历和中序遍历时,中序遍历是不定的。例如,前序遍历为ABCD,后序遍历为CBDA,那么中序遍历有CBAD和BCAD两种。现在的问题就是给定前序和后序遍历序列,要求出总共有多少棵不同形态的二叉树满足这样的遍历顺序。Input:整个输入有两行,第一行给出前序遍历的访问顺序,第二行给定后序比那里的访问顺序,二叉树节点用一个大写字母表示,不会有两个节点标上相同的字母。输入数据不包含空格,且保证至少有一棵二叉树满足要求。Output:输出一个整数,表示符合要求的不同形态二叉树的数目。Exa原创 2011-05-07 17:23:05 · 135 阅读 · 0 评论 -
POJ 1577--Falling Leaves
n skip over the definitions of a binary tree of letters, leaves of a binary tree, and a binary search tree of letters, and go right to The problem.A binary tree of letters may be one of two things:It may be empty.It may have a root node.原创 2011-05-10 20:35:19 · 173 阅读 · 0 评论 -
POJ 1107 W's Cipher题解
om dog collars, to pencils, to fishing bobbers. All these devices have very small memories. Encryption algorithms like Rijndael, the candidate for the Advanced Encryption Standard (AES) are demonstrably secure but they don't fit in such a tiny memo原创 2011-06-27 21:06:13 · 137 阅读 · 0 评论 -
POJ 2001 Shortest Prefixes
ty string is not considered a prefix in this problem, but every non-empty string is considered to be a prefix of itself. In everyday language, we tend to abbreviate words by prefixes. For example, "carbohydrate" is commonly abbreviated by &原创 2011-06-28 21:51:35 · 87 阅读 · 0 评论