上一页 1 ··· 3 4 5 6 7 8 9 下一页
  2013年4月30日
摘要: 1 class Solution { 2 public: 3 bool isInterleave(string s1, string s2, string s3) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 if(s1.size()==0&&s2.size()==0&&s3.size()==0) 7 return true; 8 if(s1.size()+s2.siz... 阅读全文
posted @ 2013-04-30 22:22 宇睿 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 int threeSumClosest(vector<int> &num, int target) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 int i,j,k; 7 int r; 8 int len=num.size(); 9 r=INT_MAX/10;10 for(i=0;i<le... 阅读全文
posted @ 2013-04-30 17:36 宇睿 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 bool isSameTree(TreeNode *p, TreeNode *q) {13 // S... 阅读全文
posted @ 2013-04-30 17:18 宇睿 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 vector<vector<int> > pathSum(TreeNode *root, int sum) {13 ... 阅读全文
posted @ 2013-04-30 17:07 宇睿 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 bool hasPathSum(TreeNode *root, int sum) {13 // St... 阅读全文
posted @ 2013-04-30 16:30 宇睿 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 vector<int> plusOne(vector<int> &digits) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 int c=0; 7 int i=digits.size()-1; 8 vector<int> v; 9 int t=digits[i];10 digits[i... 阅读全文
posted @ 2013-04-30 16:19 宇睿 阅读(154) 评论(0) 推荐(0) 编辑
  2013年4月29日
摘要: sedhttp://bbs.linuxtone.org/thread-1710-1-1.htmlawkhttp://bbs.linuxtone.org/thread-1714-1-1.html 阅读全文
posted @ 2013-04-29 03:24 宇睿 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 转自http://bbs.linuxtone.org/thread-1731-1-1.html比如,要将目录/modules下面所有文件中的zhangsan都修改成lisi,这样做:sed -i"s/zhangsan/lisi/g" `grep zhangsan -rl /modules`解释一下:-i 表示inplace edit,就地修改文件-r 表示搜索子目录-l 表示输出匹配的文件名这个命令组合很强大,要注意备份文件。(1)sed 'y/1234567890/ABCDEFGHIJ/' test_sedsed 'y/1234567890/ABC 阅读全文
posted @ 2013-04-29 03:19 宇睿 阅读(202) 评论(0) 推荐(0) 编辑
  2013年4月28日
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 #include <valarray>10 using namespace std;11 12 13 void print(int i)14 {15 cou 阅读全文
posted @ 2013-04-28 23:17 宇睿 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <string> 3 #include <iostream> 4 #include <fstream> 5 #include <iterator> 6 #include <vector> 7 #include <algorithm> 8 #include <map> 9 using namespace std;10 11 12 class Student13 {14 private:15 int sno;16 public:17 Stu 阅读全文
posted @ 2013-04-28 22:57 宇睿 阅读(251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页