摘要: 由图(1)可知当最后一块矩形垂直摆放则 fn 由 fn-1 决定,即:fn=fn-1; 由图(2)可知当最后一块矩形水平摆放则 fn 由 fn-2 决定,即:fn=fn-2; 综上: fn = fn-1 + fn-2 ; 仍然是个斐波那契级数问题: class Solution { public: 阅读全文
posted @ 2016-06-13 19:22 强子GOR 阅读(121) 评论(0) 推荐(0)
摘要: 题目加大难度: 阅读全文
posted @ 2016-06-13 17:17 强子GOR 阅读(681) 评论(0) 推荐(0)
摘要: /** *给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢? *输出需要删除的字符个数。 *输入描述: *输入数据有多组,每组包含一个字符串s,且保证:1 #include #include using namespace std; int main() { string s; const int MAXN=1010; ... 阅读全文
posted @ 2016-06-08 13:56 强子GOR 阅读(151) 评论(0) 推荐(0)
摘要: 题目:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two en 阅读全文
posted @ 2016-03-29 14:20 强子GOR 阅读(130) 评论(0) 推荐(0)
摘要: 题目:Write a function to find the longest common prefix string amongst an array of strings. 题解:给出的函数为:char* longestCommonPrefix(char** strs, int strsSiz 阅读全文
posted @ 2016-03-27 17:19 强子GOR 阅读(363) 评论(0) 推荐(0)
摘要: 题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lon 阅读全文
posted @ 2016-03-26 23:20 强子GOR 阅读(182) 评论(0) 推荐(0)
摘要: http://www.boost.org/ :It provides free peer-reviewed portable C++ source librarieshttp://www.cplusplus.com/ :Non-technical information about the C++... 阅读全文
posted @ 2015-01-08 14:58 强子GOR 阅读(819) 评论(4) 推荐(1)
点击右上角即可分享
微信分享提示