摘要: #include #include #include #include #include using namespace std;struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} };ListNode* addTwoNumbers(ListNode* l1, ... 阅读全文
posted @ 2016-03-07 16:49 HUSTLX 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; vector> fourSum(vector& nums, int target) { vector> res; sort(nums.begin(), nums.end()); int len = nums.size(); for (i... 阅读全文
posted @ 2016-03-07 16:48 HUSTLX 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std; int threeSumClosest(vector& nums, int target) { sort(nums.begin(), nums.end()); int len = nums.size(); int min = INT_MAX; ... 阅读全文
posted @ 2016-03-07 14:57 HUSTLX 阅读(169) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std;vector> threeSum(vector& nums) { sort(nums.begin(), nums.end()); int len = nums.size(); vector> res; for (int i = 0; i num... 阅读全文
posted @ 2016-03-07 10:22 HUSTLX 阅读(182) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;vector twoSum(vector& nums, int target) { int len = nums.size(); map temp; vector re; for (int i = 0; i second); re.push_... 阅读全文
posted @ 2016-03-07 09:09 HUSTLX 阅读(166) 评论(0) 推荐(0) 编辑