2010年12月15日

摘要: 该题主要是简单的模拟,用递归实现可以用一个二维数组存储走到i,j位置时,所经历的步数DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions areN north (up the page)S south (down the page)E east (to the right on 阅读全文
posted @ 2010-12-15 21:15 yming0221 阅读(146) 评论(0) 推荐(0)
摘要: 本题使用记忆话递归即可,也可以用动态规划DP不过得使用三维数组,空间复杂度比较高Function Run FunTime Limit:1000MSMemory Limit:10000DescriptionWe all love recursion! Don't we?Consider a three-parameter recursive function w(a, b, c):if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) returns:1if a > 20 or b > 20 or c > 20, 阅读全文
posted @ 2010-12-15 21:04 yming0221 阅读(149) 评论(0) 推荐(0)

导航