上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 73 下一页
摘要: "题目" c++ 解题思路,先用栈,模拟一下括号匹配,然后维护一个数字,能够进行括号匹配的都标上1 最后计算一下最长连续的1的区间长度就可以了。 class Solution { public: int a[100005]; char stack[100005]; int stack2[100005 阅读全文
posted @ 2019-07-22 14:06 Shendu.CC 阅读(75) 评论(0) 推荐(0) 编辑
摘要: "题目" c++ 阅读全文
posted @ 2019-07-17 16:36 Shendu.CC 阅读(100) 评论(0) 推荐(0) 编辑
摘要: "题目" 食之无味的题目 class Solution { public: map m; map m2; map m3; int b[100005]; int c[100005]; vector findSubstring(string s, vector& words) { vector ans; 阅读全文
posted @ 2019-07-16 19:14 Shendu.CC 阅读(83) 评论(0) 推荐(0) 编辑
摘要: "题目" 使用位运算模拟除法。 思路很简单。首先可以想到拿被除数减去除数,直到不能减为止。 但是这是很low的,我们可以用倍增的思想,任何数字都可以由2^x+2^y+2^z......组成的。 所以我们用被除数减去 除数 2^x ,那么商就+= 2^x ,然后减去得到差,继续再减 除数的2^x cl 阅读全文
posted @ 2019-07-15 20:48 Shendu.CC 阅读(87) 评论(0) 推荐(0) 编辑
摘要: "题目" 实现一个字符串 indexOf()的功能。class Solution { public: int next[100005]; int strStr(string haystack, string needle) { if(needle=="") return 0; return KMP( 阅读全文
posted @ 2019-07-13 09:54 Shendu.CC 阅读(82) 评论(0) 推荐(0) 编辑
摘要: "题目" c++ class Solution { public: int removeElement(vector& nums, int val) { int ans = nums.size(); int i=0; while(i 阅读全文
posted @ 2019-07-12 10:05 Shendu.CC 阅读(76) 评论(0) 推荐(0) 编辑
摘要: "题目" class Solution { public: int removeDuplicates(vector& nums) { int ans=nums.size(); int i=1; while(i 阅读全文
posted @ 2019-07-11 18:10 Shendu.CC 阅读(103) 评论(0) 推荐(0) 编辑
摘要: "题目" include include using namespace std; int dfs(int a,int b,int ans) { if(a%b==0) { return ans; } else if(a b&&a 阅读全文
posted @ 2019-07-10 10:11 Shendu.CC 阅读(75) 评论(0) 推荐(0) 编辑
摘要: "题目" 阅读全文
posted @ 2019-07-09 19:19 Shendu.CC 阅读(110) 评论(0) 推荐(0) 编辑
摘要: "题目" 阅读全文
posted @ 2019-07-04 14:26 Shendu.CC 阅读(81) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 73 下一页