摘要: 题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数)。没多久,他就得到另一组连续正数和为100的序列:18,19,20,21,22。现在把问题交给你,你能不能也很快 阅读全文
posted @ 2017-07-31 10:39 双马尾是老公的方向盘 阅读(89) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int StrToInt(string str) { int flag,index=0; if(str[0]=='+'){ flag=1; index++; } if(str[0]=='-'){ ... 阅读全文
posted @ 2017-07-30 23:00 双马尾是老公的方向盘 阅读(125) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int rectCover(int number) { if (number == 0) return 0; else if (number == 1) return 1; else if (number == 2) return 2; ... 阅读全文
posted @ 2017-07-30 22:29 双马尾是老公的方向盘 阅读(152) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int Fibonacci(int n) { if (n != 0) { vector array; array.push_back(1); array.push_back(1); int k = 2;... 阅读全文
posted @ 2017-07-30 22:26 双马尾是老公的方向盘 阅读(162) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int jumpFloorII(int number) { if (number == 1) { return 1; } else if (number == 2) { return 2; ... 阅读全文
posted @ 2017-07-30 22:17 双马尾是老公的方向盘 阅读(130) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int jumpFloor(int number) { // if (number == 1) { return 1; } else if (number == 2) { return... 阅读全文
posted @ 2017-07-30 22:08 双马尾是老公的方向盘 阅读(93) 评论(0) 推荐(0) 编辑
摘要: /** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : * val(x), next(NULL) { * } * }; */ class Solution { public: vector print... 阅读全文
posted @ 2017-07-30 22:00 双马尾是老公的方向盘 阅读(110) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: ListNode* EntryNodeOfLoop(ListNode* pHead) { vector vec; ListNode* list = NULL; if (pHead == NULL) return NULL; int flag = 0; ... 阅读全文
posted @ 2017-07-30 21:47 双马尾是老公的方向盘 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 递归版本: 阅读全文
posted @ 2017-07-30 21:39 双马尾是老公的方向盘 阅读(126) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: ListNode* deleteDuplication(ListNode* pHead) { if (pHead == NULL) return pHead; if (pHead->next == NULL) return pHead; int First = pHe... 阅读全文
posted @ 2017-07-30 21:24 双马尾是老公的方向盘 阅读(126) 评论(0) 推荐(0) 编辑