摘要: class Solution {public: int searchInsert(vector& nums, int target) { int left=0; int right=nums.size()-1; int mid; if(... 阅读全文
posted @ 2015-08-02 21:36 *桔子* 阅读(150) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: string countAndSay(int n) { string res; if(n<=0) return res; res += '1'; for(int i=0;i<n-1;... 阅读全文
posted @ 2015-08-02 21:05 *桔子* 阅读(136) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int search(vector& nums, int target) { return rotate_search(nums,0,nums.size()-1,target); } int rotate_search(... 阅读全文
posted @ 2015-08-02 20:30 *桔子* 阅读(175) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int removeDuplicates(vector& nums) { vectornew_nums; int s = nums.size(); int len=0; for(int i=... 阅读全文
posted @ 2015-08-02 19:31 *桔子* 阅读(132) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int removeElement(vector& nums, int val) { vector new_nums; int i=0; int s=nums.size(); while(i... 阅读全文
posted @ 2015-08-02 19:30 *桔子* 阅读(145) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int lengthOfLastWord(string s) { int i=0; int len=0; while(s[i]&&s[i]==' ') i++; //去掉开头的空格 boo... 阅读全文
posted @ 2015-08-02 17:50 *桔子* 阅读(128) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: string addBinary(string a, string b) { string res; int s1=a.size(); int s2=b.size(); if(s1==0) ... 阅读全文
posted @ 2015-08-02 16:26 *桔子* 阅读(152) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: vector plusOne(vector& digits) { vector res; int s= digits.size(); if(s==0) return res; int tem... 阅读全文
posted @ 2015-08-02 15:32 *桔子* 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 亲测 可以安装 过程并不复杂 但可能需要一些时间 认真一点 按照步骤 一定可以成功哒 其他版本可以将ftp.gnu.org/gnu/gcc/敲入浏览器,找到自己需要的文件;【安装过4.9.0;成功;用的是gmp-4.3.2 mpc-0.8.1 mpfr-2.4.2】 以4.6.1为例,其他的版本类似 阅读全文
posted @ 2015-08-02 15:31 *桔子* 阅读(2982) 评论(0) 推荐(1) 编辑