02 2017 档案

摘要:报错情况:在导入数据时候发现找不到InnoDB这个错误,之前查看博客时候明白了IsAsm数据库和InnoDB这两个的区别了。 解决方案: 尝试一:将my.ini配置文件的isasm改成InnoDB。这个是之前参考博客完成。但是这个没有奏效。 尝试二:想到这个应该是没有完成服务器的重启,但是通过php 阅读全文
posted @ 2017-02-22 16:45 王坤1993 阅读(1333) 评论(0) 推荐(0)
摘要:class Solution { public: vector<int> searchRange(vector<int>& nums, int target) { int idx = search(nums, 0, nums.size() - 1, target); if (idx == -1) r 阅读全文
posted @ 2017-02-15 23:00 王坤1993 阅读(147) 评论(0) 推荐(0)
摘要:public class Solution { public int search(int[] A, int target) { int l = 0; int r = A.length - 1; while (l <= r) { int mid = (l + r) / 2; if (target = 阅读全文
posted @ 2017-02-15 00:01 王坤1993 阅读(144) 评论(0) 推荐(0)
摘要:class Solution { public: int longestValidParentheses(string s) { int res = 0, start = 0; stack<int> m; for (int i = 0; i < s.size(); ++i) { if (s[i] = 阅读全文
posted @ 2017-02-13 23:36 王坤1993 阅读(126) 评论(0) 推荐(0)
摘要:class Solution { public: void nextPermutation(vector<int> &num) { int i, j, n = num.size(); for (i = n - 2; i >= 0; --i) { if (num[i + 1] > num[i]) { 阅读全文
posted @ 2017-02-13 00:00 王坤1993 阅读(137) 评论(0) 推荐(0)
摘要:class Solution { public: vector<int> findSubstring(string s, vector<string>& words) { if (s.empty() || words.empty()) return {}; vector<int> res; int 阅读全文
posted @ 2017-02-12 00:02 王坤1993 阅读(199) 评论(0) 推荐(0)
摘要:class Solution { public: int divide(int dividend, int divisor) { long long res = 0; long long m = abs((long long)dividend), n = abs((long long)divisor 阅读全文
posted @ 2017-02-12 00:01 王坤1993 阅读(149) 评论(0) 推荐(0)
摘要:class Solution { public: int strStr(string haystack, string needle) { if (needle.empty()) return 0; int m = haystack.size(), n = needle.size(); if (m 阅读全文
posted @ 2017-02-12 00:00 王坤1993 阅读(202) 评论(0) 推荐(0)
摘要:class Solution { public: int removeElement(vector<int>& nums, int val) { int res = 0; for (int i = 0; i < nums.size(); ++i) { if (nums[i] != val) nums 阅读全文
posted @ 2017-02-11 23:59 王坤1993 阅读(128) 评论(0) 推荐(0)
摘要:class Solution { public: int removeDuplicates(int A[], int n) { if (n <= 1) return n; int pre = 0, cur = 0; while (cur < n) { if (A[cur] == A[pre]) ++ 阅读全文
posted @ 2017-02-11 23:57 王坤1993 阅读(97) 评论(0) 推荐(0)
摘要:class Solution { public: ListNode* reverseKGroup(ListNode* head, int k) { ListNode *cur = head; for (int i = 0; i < k; ++i) { if (!cur) return head; c 阅读全文
posted @ 2017-02-10 22:42 王坤1993 阅读(108) 评论(0) 推荐(0)
摘要:class Solution { public: ListNode* swapPairs(ListNode* head) { if (!head || !head->next) return head; ListNode *t = head->next; head->next = swapPairs 阅读全文
posted @ 2017-02-10 22:38 王坤1993 阅读(136) 评论(0) 推荐(0)
摘要:struct cmp { bool operator () (ListNode *a, ListNode *b) { return a->val > b->val; } }; class Solution { public: ListNode *mergeKLists(vector<ListNode 阅读全文
posted @ 2017-02-10 22:35 王坤1993 阅读(133) 评论(0) 推荐(0)
摘要:class Solution { public: vector<string> generateParenthesis(int n) { set<string> t; if (n == 0) t.insert(""); else { vector<string> pre = generatePare 阅读全文
posted @ 2017-02-10 22:32 王坤1993 阅读(145) 评论(0) 推荐(0)
摘要:class Solution { public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { if (!l1) return l2; if (!l2) return l1; if (l1->val < l2->val) { l1->ne 阅读全文
posted @ 2017-02-10 22:29 王坤1993 阅读(111) 评论(0) 推荐(0)
摘要:class Solution { public: bool isValid(string s) { stack<char> parentheses; for (int i = 0; i < s.size(); ++i) { if (s[i] == '(' || s[i] == '[' || s[i] 阅读全文
posted @ 2017-02-10 22:27 王坤1993 阅读(133) 评论(0) 推荐(0)
摘要:class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { if (!head->next) return NULL; ListNode *pre = head, *cur = head; for (int 阅读全文
posted @ 2017-02-10 22:25 王坤1993 阅读(102) 评论(0) 推荐(0)
摘要:class Solution { public: vector<vector<int> > fourSum(vector<int> &nums, int target) { set<vector<int> > res; sort(nums.begin(), nums.end()); for (int 阅读全文
posted @ 2017-02-10 00:01 王坤1993 阅读(144) 评论(0) 推荐(0)
摘要:class Solution { public: vector<string> letterCombinations(string digits) { vector<string> res; if (digits.empty()) return res; string dict[] = {"abc" 阅读全文
posted @ 2017-02-08 22:27 王坤1993 阅读(139) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2017-02-08 00:07 王坤1993 阅读(145) 评论(0) 推荐(0)
摘要:class Solution { public: int threeSumClosest(vector<int>& nums, int target) { int closest = nums[0] + nums[1] + nums[2]; int diff = abs(closest - targ 阅读全文
posted @ 2017-02-08 00:03 王坤1993 阅读(104) 评论(0) 推荐(0)
摘要:class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { set<vector<int>> res; sort(nums.begin(), nums.end()); for (int k = 0; k < n 阅读全文
posted @ 2017-02-07 00:00 王坤1993 阅读(158) 评论(0) 推荐(0)
摘要:class Solution { public: string longestCommonPrefix(vector<string>& strs) { if (strs.empty()) return ""; for (int j = 0; j < strs[0].size(); ++j) { fo 阅读全文
posted @ 2017-02-06 00:06 王坤1993 阅读(124) 评论(0) 推荐(0)
摘要:class Solution { public: int romanToInt(string s) { int res = 0; unordered_map<char, int> m{{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D' 阅读全文
posted @ 2017-02-04 23:38 王坤1993 阅读(121) 评论(0) 推荐(0)
摘要:class Solution { public: string intToRoman(int num) { string res = ""; vector<int> val{1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; vector<s 阅读全文
posted @ 2017-02-04 00:17 王坤1993 阅读(173) 评论(0) 推荐(0)
摘要:class Solution { public: bool isMatch(string s, string p) { int m = s.size(), n = p.size(); vector<vector<bool>> dp(m + 1, vector<bool>(n + 1, false)) 阅读全文
posted @ 2017-02-01 21:07 王坤1993 阅读(159) 评论(0) 推荐(0)
摘要:class Solution {public: bool isPalindrome(int x) { //negative number if(x < 0) return false; int len = 1; while(x / len >= 10) len *= 10; while(x > 0) 阅读全文
posted @ 2017-02-01 21:03 王坤1993 阅读(155) 评论(0) 推荐(0)
摘要:public class Solution { public int myAtoi(String str) { if (str.isEmpty()) return 0; int sign = 1, base = 0, i = 0, n = str.length(); while (i < n && 阅读全文
posted @ 2017-02-01 00:26 王坤1993 阅读(184) 评论(0) 推荐(0)