本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss
摘要: 一个n*m的网格,求这个网格中矩形的数目。 比如以下2*2网格,总共有9个矩形:4个1*1的矩形,4个1*2的矩形,1个2*2的矩形 算法1:动态规划,假设dp[i][j]表示以第 i 行第 j 列的格子为右下角顶点的矩形数目,那么dp[i][j] = 1 + dp[i-1][j] + dp[i][j-1] – dp[i-1][j-1] , 这里的1表示i ,j 位置的格子自身构成1... 阅读全文
posted @ 2014-05-20 22:10 tenos 阅读(5103) 评论(0) 推荐(2) 编辑
摘要: 题目链接The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed f... 阅读全文
posted @ 2014-05-20 13:19 tenos 阅读(6261) 评论(0) 推荐(0) 编辑

本博客rss订阅地址: http://feed.cnblogs.com/blog/u/147990/rss

公益页面-寻找遗失儿童