上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 46 下一页
摘要: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 class Solution { 9 public: 10 double findMedianSortedArra... 阅读全文
posted @ 2014-09-19 19:04 卖程序的小歪 阅读(311) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: int shd_cnt[256]; int cur_cnt[256];public: string minWindow(string S, string T) { int slen = S.length(); ... 阅读全文
posted @ 2014-09-16 20:54 卖程序的小歪 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 记忆搜索总是一个快速的方法(这里假设测试用例中s1和s2的长度都不超过(2^16) - 1), 当然用记忆搜索的,往往就可以写成DP的形式的,不用担心大数据时栈溢出了#include #include #include #include #include using namespace std;cl... 阅读全文
posted @ 2014-09-16 18:50 卖程序的小歪 阅读(204) 评论(0) 推荐(0) 编辑
摘要: class Solution {#define SINGLE 1#define MULTIP 2public: bool isMatch(const char *s, const char *p) { if (s == NULL || p == NULL) return true... 阅读全文
posted @ 2014-09-14 00:27 卖程序的小歪 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 using namespace std; 11 12 typedef pa... 阅读全文
posted @ 2014-09-13 02:47 卖程序的小歪 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 室友在做于是也做一发,跟已知两种遍历序列还原二叉树的思路类似,感觉PAT上的题目跟书本知识靠的近一些#include #include #include using namespace std;void print_data(const vector &as, const vector &ns) {... 阅读全文
posted @ 2014-09-12 00:10 卖程序的小歪 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2014-09-11 00:31 卖程序的小歪 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ... 阅读全文
posted @ 2014-08-25 00:32 卖程序的小歪 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 int main() { 4 long n, a, b, c; 5 long i; 6 int ga, gb, gc, r; 7 scanf("%ld", &n); 8 for (i=... 阅读全文
posted @ 2014-08-20 23:46 卖程序的小歪 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 在终端下输大量的命令,有些快捷键还是挺有帮助的。跳跃跳到最后 ctrl + e (end)跳到最前 ctrl + a (abcde....)向后跳一个单词 alt + 右方向键向前跳一个单词 alt + 左方向键删除删除当前到最后中的字符 ctrl + k删除当前到最前中的字符 ctrl + u删除... 阅读全文
posted @ 2014-08-20 10:26 卖程序的小歪 阅读(228) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 46 下一页